Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SDL Multisampling

I've been trying to get SDL FSAA with Multisampling working, but it doesn't want to.

I started with something simple:

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

But I do the associated gets and it returns 0 for buffers and 1 for samples. (both before and after SetVideo).

I tried it both on my GeForce 280M, and suspecting it was a mobile issue, tried it on my 580 with no luck either.

I'm running Windows 7 with up to date drivers.

If I force FSAA on in the NVidia Control Panel it works great, but I can't seem to get the application to enable it.

Any ideas?

like image 845
Chad Mourning Avatar asked Nov 30 '11 18:11

Chad Mourning


1 Answers

Those functions should return 0 or -1. They should never return 1 . . . so I don't know what's going on there. Are those return values for some other function?

Anyway, it's important to note that these are requests. There's no guarantee that they are what you think they are. That's why the SDL_GL_GetAttribute function exists (call it AFTER SDL_SetVideoMode to see what you got).

You're requesting a multisampling buffer with two samples per pixel. That's not a terribly large amount of multisampling. BEFORE SDL_SetVideoMode, try the following:

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

And if you see smoothed edges, don't worry about it.

like image 98
imallett Avatar answered Sep 21 '22 23:09

imallett