Archived

This topic is now archived and is closed to further replies.

glFogCoordfEXT Help!

This topic is 5674 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites