PDA

View Full Version : Is this an aliasing issue?



MeanFox.com
06-23-2004, 07:19 AM
I'm drawing outlined fonts which are moving, and the camera is slowly moving too. I'm blending each frame with previous frames, so that the moving fonts leave a kind of motion blur trail.

The problem is that at certain camera angles, there are some "sparkle anomalies". They occur along the intersections of the swept shapes and look a bit like dotted white lines.

Is this some sort of aliasing problem? Or is it related to the camera? It seems to happen when the camera is low enough that the font text is moving through the near clipplane.

Any ideas?

Thanks,

Tom

endash
06-23-2004, 09:29 AM
If the fonts have a hard edge, then I'm not sure how blending with the previous frame would cause the shimmering artificats you describe.

Can you post a screenshot?

MeanFox.com
06-23-2004, 04:48 PM
Here is a screenshot showing the white dots along the groove that the moving text makes:

Sparkles anomaly (http://www.meanfox.com/images/sparkles.jpg)

I am clearing the depth buffer every frame. Hope someone can identify what this anomaly is - it is very noticeable.

Tom

MatthewL
06-23-2004, 05:04 PM
Perhaps it's due to low precision?
Could it be that the triangles are getting so small that their vertices are going behind the decimal too far?

Or maybe your Z-Buffer precision is too low. (Is it 16 or 32-Bit?)

MeanFox.com
06-23-2004, 05:12 PM
z-buffer is 32 bit. But I don't think this can be a depth buffer issue. The anomalies occur where previous frames are blended. This is done by clearing the depth buffer but not the color buffer. The blend is:

::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

MatthewL
06-23-2004, 05:24 PM
Maybe your alphabits are set too low? (just guessing :D )

MeanFox.com
06-23-2004, 05:51 PM
Hmmm - it could be something to do with that. When I lower the alpha further, the anomaly grows worse. I'll look into that. Aside from increasing the alpha, is there a solution to this problem?

Cheers,

Tom

V-man
06-24-2004, 05:28 AM
The alpha bitplane is unused for that kind of blending

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Notice the "SRC" for both parameters.

If you are moving the text forward, then some of the white pixels are not beeing touched, so they get left behind. It's similar to the T-junction issue.

meanfox
06-24-2004, 05:32 PM
In other words, not an artifact at all... expected behavior. Right?

Guess in that case all I can do is attempt to lessen it...

Thanks,

Tom

dorbie
06-24-2004, 06:51 PM
Turn on back face culling. Your inside polygons are showing through your outside polygons at the silhouette and the lighting doesn't match. Don't think this should happen but culling will fix it.

Eric Lengyel
06-24-2004, 09:46 PM
What hardware are you running this on? I've seen edge artifacts like this before on older Nvidia (NV20-class) cards, and I believe it is a hardware bug.

meanfox
06-25-2004, 06:31 AM
Backface culling is already on.

My videocard is a GeForce FX5600 with the latest drivers.

I'm wondering if vman is right and that this is just some poor leftover pixels. In which case how to lessen the problem?

gdewan
06-25-2004, 07:25 AM
Looking at that picture, I would guess that you are getting burned by numerical precision issues.

If the vertices of the backs of the letters do not match up exactly to the vertices of the front of the previous frames letters, the edges can rasterize slightly different, resulting in some pixels from the front of the letters of the previous frame showing through.

I don't think there is much you can do about it (at least robustly), though turning FSAA on may hide the problem to some degree.

V-man
06-26-2004, 05:25 AM
or inflate the text (scale) as you move it forward or make the front of your text less bright ....

meanfox
06-26-2004, 05:27 PM
Changing the lighting a bit might lessen the problem a little.

The camera is also moving around a bit, which is probably why I am seeing the problem at all.

Thanks for all the ideas, folks.

King Fuzzy
06-27-2004, 01:22 PM
in the first message you said outlined fonts,
Can you post a picture of one of the frames rendered without the previous frame blended in so we can see the actual object you are rendering

I have seen a similar effect when drawing a line using a custom brush, it was caused by the outline not compleatly covering the all of the main graphic
I dont know if this will help but try increacing the size of the outline

MikeM
06-28-2004, 01:39 PM
Try something like this...

Right before you render your next frame (on top of the existing frame buffer), render a large, black, screen-size quad transparently (alpha < 0.02 or so) over the entire frame. Any of those leftover pixels will be slowly darkened so as to be less visible.

-or-

as an alternative, you can follow up your rendering of the extruded fonts with a rendered outline of the font in a 3 pixel wide, black line. That would likely cover those pixels with black before they even get a chance to be 'left behind'

Good luck.