problems with radial fog

i’m testing approaches to landscape modeling/rendering for a planetary rendering engine.
i made a landscape testbed that uses perlin fractal noise for heightmapping and it works ok.

a texture is tiled on the landscape to give a better impression of the terrain below.

the testbed renders a patch at a time and as you move and some of the patch verts are invalidated, they are resampled from the fractal: new polygons appear at the horizon.

to avoid this, i’ve first implemented opengl linear fog, and it worked good, but due to the nature of the algo, it has the unpleasant appearance of landscape appearing/desappearing as the camera rotates.
also it hides too much polygons in the best case.

so i implemented a custom linear radial fog algo, wich it works, but have the problem that it don’t work good with textures.

the texture completely in fog don’t disappear, but it is modulated with the poly color.

it has to work this way, since to fog a polygon i have to assign a vertex color.

the question is: is there any extension wich let me assign a fog blend factor to a vertex, and let the opengl system fog the primitives correctly, even with textures?
or maybe some multiple pass approach?

Dolo//\ightY

Hello

There is an extention called EXT_fog_coord, maybe that is what you are looking for.
http://www.opengl.org/Documentation/Version1.2/EXTspecs/fog_coord.txt

Bob

Or you can try a 2nd pass, blend with polygons that are fogged with your own radial fog… somehow.

well no, since the NV10 supports EXT_fog_coord, i’m going to use that extension.

not so opengl-related, but have some of you implemented some versions of fractal noise?
i’d like to compare my version with others…

Dolo//\ightY