glFogCoordfEXT Help!

Started by
3 comments, last by Xero-X2 21 years, 10 months ago
just a simple question and a small request 1. what relationship does glFogCoordfEXT have with vertexes you draw. 2. could some one explain how to use glFogCoordfEXT on a height map. If you don''t feel like answering those about please point me to some where I can learn, with explenation, about useing volometric fog with glFogCoordfEXT?
"I seek knowledge and to help those who also seek it"
Advertisement
DigiBen
Recently did a volumetric fog tutorial.

------------
aud.vze.com - The Audacious Engine <-- Newbie alert, look at your own risk. Can induce severe laughing fits and other variations of hysterical outburst.

[edited by - LockePick on June 5, 2002 2:19:34 AM]
_______________________________________Pixelante Game Studios - Fowl Language
I''ll check it out.
"I seek knowledge and to help those who also seek it"
1. Without glFogCoordEXT, the fog only depends on the depth fragment of the vertex, which is either linear, exponential, or square exponential. With glFogCoordEXT you define your fog yourself. It''s useful for volumetric fog, also it''s useful for some effects like volumetric light.

2. There''s nothing special to say about glFogCoordEXT on a heightmap. A heightmap is just a mesh like any other, even though heightmap has some particular topogical properties. To use glFogCoordEXT on a heightmap, you have to cal glFogCoordEXT(my_fog_coord) BEFORE EACH CALL to glVertex(my_vertex), just like glColor or glTexCoord (or glNormal...).

It is pretty straight forward to create the volumetric fog effect with the fog_coord extension. What you need is to know where is the fog and what is the volume (a sphere, a cube, ...). Then for each vertex and every time the camera moves or the object moves, you have to compute fog coordinates that represents the "quantity of fog that lies between the viewpoint and the vertex".

It''s likely to be computer-intensive, so you may want to sort objects and don''t apply fog on objects which you are sure are unaffected by fog.

With vertex programs, you can save a bit of CPU and let the GPU compute the fog coordinates automatically.

I have a zipped file that shows the usage of the GL_EXT_fog_coord extension, but there are just the basics. If you want information about volumetric fog specifically, you may STFW.
Thanks for the explenation it really helped me under stand it. I got it to work I just had to remember to set it up with GL_FOG.
"I seek knowledge and to help those who also seek it"

This topic is closed to new replies.

Advertisement