Frage

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.

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top