View Full Version : Vertex program fog

Roman Grigoriev
05-15-2003, 03:52 AM
Hi guys!
I try to implement height based fog on vertex programs and got this result: http://fgfs.narod.ru/screen1.jpg
As you see on non highly tesselated surface you got dissapointing results http://www.opengl.org/discussion_boards/ubb/frown.gif(
Is there a way to improve it as in fixed pipeline fog?
Thanx in advance

05-15-2003, 08:51 AM
Your problem is that the fog is interpolated per-vertex. You should be computing the height and fog value per-fragment intead.

Roman Grigoriev
05-15-2003, 07:27 PM
so it could be done via fragment programs only?

05-15-2003, 09:36 PM

How did you do the vertex program fog? I tried to find some information some time ago but I didn't succeed. Can you post some code or ideas?