I am working on scene antialiasing and i want to choose a best strategy for me.
Can you please help me… I cannot understand some things also.
My program uses shaders to draw meshes and apply light and material.
As far as i understood there are basically 2 strategies:
- Use polygon smoothing.
I really do not understand why and what it smoothes…
For example (just hypothetically speaking), I have an object X (close to camera, Ad = 1, destination) and object Y (far from camera and is overlapped by object X, As = 1, source). Both objects are composed of several triangles.
I switch of depth buffer, draw object X first, and then Y.
When I draw object Y, there are two possibilities:
a) As = Ad = 1 (no overlapping edges)
Resulting color is: Color = Ad*ColorX + min(As, 1-Ad)ColorY = 1ColorX + min(1, 0)*ColorY = ColorX.
This is correct since we keep the color of close ofbect X.
b) As = 1, Ad = 0.7 (any value) (object X has an edge, let’s assume this edge connects two triangles from object X, that is the edge is “inside” object X)
Resulting color is: Color = AdColorX + min(As, 1-Ad)ColorY = 0.7ColorX + min(1, 0.3)ColorY = 0.7ColorX +0.3ColorY.
This is not correct since edge is “inside” of X and we should not see any part of object Y.
The correct answer should be Color = ColorX.
c) As = 1, Ad = 0.7 (any value) (object X has an edge, let’s assume this edge is on the border of object X)
then we get same result as in b) but it is correct now.
So, I am sure I misunderstand something, but point b) is very confusing. Can you point me my mistake?
- Second antialiasing method is a global antialiasing:
a) I understand Accumulation Buffer, but i think that it is better to move objects (each with different translation) instead of frustum. Thus, we will have same jitter independent on distance from camera, no over/under-blurred regions.
What is your opinion about object jitter instead of frustum jitter?
b) Use hardware technique described in NeHe . The question is: will it work for me since I already use my own written shaders?