سؤال

To enable multisampling I am using the following code in my project:

SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);

Do I also need to call glEnable(GL_MULTISAMPLE);?

I see no difference if I don't call it.

هل كانت مفيدة؟

المحلول

Yes, without enabling multisampling primitives will get rendered aliased. This is a feature, because some graphics algorithms break if multisampling gets applied to them, so it's desireable to deliberately enable and disable it throughout rendering.

That being said, double buffering and depth resolution have nothing to do with multisampling. The relevant attributes are SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top