Author: DigiBen
Though volumetric fog isn't just for terrains, we thought it would make a fun way to see it in action. The code is quite small to produce this effect, but it sure does make everything look "cool". This uses the glFogCoordfEXT() extension from OpenGL to only require one rendering pass. If your card can't support this (voodoo brands maybe), just make it 2 passes and use vertex colors.
Functions Used: glBegin(), glEnd(), glVertex3i(), fopen(), fread(), fclose(), glBindTexture(), glMultiTexCoord2fARB(), glTexEnvi(), gluBuild2DMipmaps(), glMatrixMode(), glActiveTextureARB(), glScalef(), glLoadIdentity(), glFogi(), glFogCoordfEXT()
purchase full version
Access EXE