Thanks for your reply.
Maybe I should learn something about ray-box intersection." for each pixel",Do you mean that I should use pixel shader? and "perform a ray-box intersection test in your fragment shader ", or fragment shader? I just don't know how to perform piexl operation.
To answer "why?" you'd have to tell us what you did with GL_EXT_fog_coord, and what you expected it to do.
That extension is designed to allow you to specify per-vertex fog in the fixed-function pipeline.
The source code is on the other computer. I used it in another engine. The engine offerd an interface for us to embed OpenGL code,I just use the GL_EXT_fog_coord to implement
volumetric fog as NeHe's lesson 41,and then draw my scene. I just want to use it to simluate visibility underwater, the fog should exist only underwater.
Thanks you again.