Antialiasing in opengl. Is there a way to do...
category: general [glöplog]
Hi all,
I'm using multisampling in opengl through the arb extension. Everything works as expected - no jaggies over the edges of triangles any more ! However,
Assume that I have a textured mapped polygon. I cannot see any antialiasing over the texture itself (which could be very useful when I have alpha blended triangles with alpha test/masking). I wonder if there is a way around that and what is the best way to antialiase the textures themselves. Any ideas ?
I'm using multisampling in opengl through the arb extension. Everything works as expected - no jaggies over the edges of triangles any more ! However,
Assume that I have a textured mapped polygon. I cannot see any antialiasing over the texture itself (which could be very useful when I have alpha blended triangles with alpha test/masking). I wonder if there is a way around that and what is the best way to antialiase the textures themselves. Any ideas ?
alpha to coverage (gl_sample_alpha_to_coverage or something) is what you want i think.
Check out the Humus' example.
Navis: For antialiased alpha-test to work you need supersampling, not multisampling. With multi-sampling, the same fragment color is assigned to all covered samples of a pixel, causing the same alpha value to be alpha-tested. With super-sampling, a new fragment is shaded for each sample of a pixel, giving potentially unique alpha-values to be tested.
Alpha to coverage is a good way of getting a similar effect, as suggested by smash.
Alpha to coverage is a good way of getting a similar effect, as suggested by smash.
Humus rocks :D
Quote:
best way to antialiase the textures themselves
Anisotropic filtering?
I thought anistropic filtering was for getting a better image quality on non-orthogonally projected textures with respect to the point of view. so i guess supersampling is what is needed and not anisotropic filtering.
Or just do a flatshaded quad per texel... a 40000 poly torus looks great that way! :)
From wikipedia:
Quote:
Like bilinear and trilinear filtering it eliminates aliasing effects, but introduces less blur at extreme viewing angles and thus preserves more detail
now that his problem is solved, can I troll and say that opengl is better than directx?
liranuna: fraid not, it works fine on d3d too. :)
liranuna: claiming you invented OpenGL is more your style ;)
oh Mall-E now that hurts :(
that's because the truth hurts!
hahaha :D
score :D
score :D