PDA

View Full Version : speckle issue



pillbug
10-17-2005, 11:56 AM
When I draw two polygons on a horizon sometimes there are miscolored pixels. Often a small horizontal line but most of the time just isolated pixels. Each polygon is made with its own glbegin/glend pair. For example,

http://static.flickr.com/30/53493187_53b4cf3a00_o.jpg

When the texture is set to modulate I get the problem. When in decal mode the problem goes away but the scene does not look as good. modulate has a much richer color. Whether I clamp or repeat my texture does not seem to affect the problem. The texture border color is transparent ... default ... changing that does not seem to affect the problem. when I use interpolate it does not really improve the problem. If I use add for textures then everything gets too bright.

It appears that the background color of the polygon is being drawn for the pixel and the texture is not being accounted for at these problem points. So, if I set clearcolor to blue the specks would still be the tan color. Is this a case where the polygons slightly overlap and my ati card does not know which texture to use?

Is this a polygon offset kind of problem? I'm stuck on this and cannot think of any alternatives that I have not tried to solve the problem.

When I draw the blue background I have the depth filter turned off. So, the depth values are the default for the background.

Also, the polygons are mip mapped. This was done with the glu stuff if I recall. So, all the mip map levels are set correctly.

Thanks in advance...grabbing at straws here. :(

jide
10-17-2005, 12:09 PM
Can you post a more little snapshot so that noone will be able to see something ? :)

It must be due to polygone overlapping.

pillbug
10-18-2005, 05:29 AM
Sorry about that, I can't show it all until I'm done! When I finish I'll post a screen shot.

Anyhow, I thought of a solution. :) Sometimes you just have to make a public spectacle to think of the idea.

So, the problem is the polygon is being drawn on the side when it gets close to the horizon. I get lines and speckles. The video card punts and just draws the color for the side of the thin polygon and not the texture. Anyhow, I just take the distance from the eye point and slightly offset each polygon down slightly with gltranslate. Now the edge does not get seen. Things look nice on the horizon. For things close to the eye I do no slgiht translation.

Now I can draw my background with a tiled approach and not one big mesh.