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),

How do I enable multisampling?


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 ! :-)

|improve this answer|||||
  • \$\begingroup\$ I think a combination of your answer and user1201210's is correct. It should be "params.AntiAlias = 8;" The higher, the better it seems. \$\endgroup\$ – James Zaghini Jun 5 '13 at 9:46
  • \$\begingroup\$ The AntiAlias value is meant to be a u8 not a boolean. Valid values are powers of two, so 2, 4, 8, 16. The device usually falls back to the next highest number if you specify a factor that is too high. 1 is usually the same as 0, but it depends if the hardware has a special meaning for 1 as an AntiAlias value. \$\endgroup\$ – Octopus Dec 11 '15 at 20:43

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;
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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