realistic fog

Started by
1 comment, last by CoderTCD 22 years, 6 months ago
I use standard opengl fogging functions and linear fog. But It has a problem that opengl calculates the distance using depth in z axis. I want it to calculate the distance using distance in x y and z. here''s the formula I want it to use distance=squareroot(xdistance^2+ydistance^2+zdistance^2) If it uses his formula the fog will be like a sphere around the viewer. someone told me that I could make it using extentions but I couldn''t find any resource for that. Does anyone have an idea?
Advertisement
There''s an article on spherical fog in the articles & resources section. Have you read that?
the fog distance extension will do the above

from the spec
>>When the fog distance mode is EYE_RADIAL_NV, the fog distance z is computed as the Euclidean distance from the center of the fragment in eye coordinates to the eye position. Specifically:
z = sqrt( xe*xe + ye*ye + ze*ze );<<

This topic is closed to new replies.

Advertisement