alpha lod and fog

alpha lod is something like varying the transparency of a primitive with distance: objects far awaw will smoothly blend with the background.

now it is possible to do it glColor4f() or something like this before rendering primitives.

but would be interesting to embed a new functionality to fogging wich makes opengl vary the alpha value of the primitive instead of blending it with a single color, like fogging actually does.

i think it should work when blending and a special fog mode are enabled, and it should have the same interface than fog, so standard fogging with GL_EXP, to say, and fog coordinates.


Interesting. What sort of situation would you use this in?

suppose you are building a space simulator:
it has a skybox with some image of deep space objects.
now, you put in there some starships: how can you make them smoothly appear from the distance? with alpha lodding.

the standard fog instead blends a vertex with the fog color, so to say if it is black and the background is not, your starship silouette will be mostly visible… bad thing.

alpha lod should be used anytime there is a non-uniform-color background.

another application. i’m working on a terrain renderer and it has fog and time-of-day sky color changing, so i have to syncronize background and fog color.

if alpha fogging was available, the only thing to be done is setting the background: the automatic transparency then will do the rest.

a little problem: alpha blending requires two access to the framebuffer… another thing to be optimized!