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