Reliable antialiasing techniques

I’ve only ever used LWJGL’s built-in anti-aliasing support (when you pass the ‘numSamples’ to the display/display mode constructor. However I’ve always found this to be highly unreliable whether it’s supported or not. For example I can’t get any antialiasing on my XP machine, despite it having a decent nVidia 6600 card. Whether you get antialiasing seems to be really finiky and I’ve never properly understood why.

I’d like to have more reliable antialiasing ('cos I hate having to tell users ‘it’s a graphics driver problem’). Are there any other techniques I could use? Some kind of ARB extension I can turn on? I’m more interested in quality rather than speed here. I’d rather not try and antialias things manually by grabbing the framebuffer and downsampling it.

Edit: Just what exactly is lwjgl doing under-the-hood with the numSamples parameter? Is it different from GL_ARB_MULTISAMPLE? Is there another way to use GL_ARB_MULTISAMPLE in lwjgl?

When you specify the samples (or coverage samples) parameter in PixelFormat, this is what happens at the native level (on WGL):

if (samples > 0) {
	putAttrib(&attrib_list, WGL_SAMPLE_BUFFERS_ARB); putAttrib(&attrib_list, 1);
	putAttrib(&attrib_list, WGL_SAMPLES_ARB); putAttrib(&attrib_list, samples); // WGL_COVERAGE_SAMPLES_NV if colorSamples > 0
	if ( colorSamples > 0 ) {
	        putAttrib(&attrib_list, WGL_COLOR_SAMPLES_NV); putAttrib(&attrib_list, colorSamples);
        }
}

Which is the ARB_multisample functionality.

An option you could try is using a framebuffer object with multisampling for rendering, then you can blit that to the single-sampled display. I guess a driver that has trouble with ARB_multisample won’t be able to do this, but you never know.

I’ll be watching this thread for suggestions. I’m doing it manually, currently, in Hexara, for the tokens & gels.

Interesting, thanks.

I’m doing headless/offscreen rendering with pbuffers - if the display fails to create with non-zero numsamples, does that mean I’m basically out of luck (short of doing something manually myself)?

Is there a way to force supersampling (like how there’s usually an option in a driver’s control panel)?

[quote=“Orangy Tang,post:4,topic:36826”]
How many samples do you specify? For example, if you’d ideally like 8 samples you could do something like:

  • Try with 8 samples
  • If 8 fails, try with 4
  • If 4 fails, use 1 sample for the framebuffer and do manual super-sampling

[quote=“Orangy Tang,post:4,topic:36826”]
No afaik. You can of course implement super-sampling with FBO (or a second pbuffer) very easily.

Thats what I’m already doing (just without the supersampling).

It just seems odd that what I’d consider good graphics cards (the 6600 was close to top end when released IIRC) just flat out refuse to support this.

Does it fail when trying multisampling on a pbuffer or with a normal Display too?

If I remember right (not at that computer now) it’d fail for any kind of display.