Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm working on a little game that uses Irrlicht. I'm pretty new to Irrlicht and I was wondering how I could enable multisampling. The device driver is EDT_OPENGL initiated as such:

IrrlichtDevice *device = createDevice(video::EDT_OPENGL,
                                        core::dimension2d<u32>(800, 700),
                                        16,
                                        NO);

How do I enable multisampling?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Here's a solution, but you'll need to call createDeviceEx instead of the current function.

You'll have to pass a SIrrlichtCreationParameters structure to the above function, with the AntiAlias member set to true (or another value ? It seems that the variable is an unsigned integer, and not a bool, never noticed that). Of course you'll have to define some other structure members in order to have the same IrrlichtDevice as the one in your question. ;)

Here's a piece of code if you prefer : (warning : I've not used Irrlicht since 1 year now)

SIrrlichtCreationParameters params = SIrrlichtCreationParameters();
params.AntiAlias = true;
params.DriverType = video::EDT_OPENGL;
params.WindowSize = core::dimension2d<u32>(800, 700);
IrrlichtDevice *device = createDeviceEx(params);

See here for (unfortunately not much) information. (the Irrlicht doc is in fact not very helpful, unfortunately)

Hope this helps, good night ! :-)

share|improve this answer
    
I think a combination of your answer and user1201210's is correct. It should be "params.AntiAlias = 8;" The higher, the better it seems. –  James Zaghini Jun 5 '13 at 9:46
add comment

Quick addendum to Minishlink's answer: AntiAlias is the number of samples to use in anti-aliasing. The following snippet comes from Irrlicht's COpenGLDriver.cpp.

// This value determines the number of samples used for antialiasing
// My experience is that 8 does not show a big
// improvement over 4, but 4 shows a big improvement
// over 2.
if(AntiAlias > 32)
    AntiAlias = 32;
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.