Skip to main content

ExponentialFog and distance

2 replies [Last post]
gmrolf
Offline
Joined: 2005-01-26

Hi all,
I just try to use ExponetialFog and I like to be able to set also the z value of the given formular (from the docs)
"The fog blending factor, f, is computed as follows:
f = e-(density * z)
where
z is the distance from the viewpoint.
density is the density of the fog."

I thought that z equals the BackClipDistance... but this has no influence to the blending when I change this during runtime (the clipping works but no effect to the fog...)
Which value has to be changed and how to get this distance?
searching in the View class wasn't succesfull.
any hints?
best regards
rolf

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nikolai
Offline
Joined: 2003-06-10

1) Isolate density in the equation.
2) Insert for z the distance you you want it to obscure totally.
3) Determine the blending factor that will give total obscurity. I guess it would be 1/(256*3) but not sure. I recon that based on 3 colors each with a fidelity of 256.
4) Try it out, discover that the equation has another factor, which I do not know how calculate into the equation: the size of the canvas.
5) Go vote for bug: https://java3d.dev.java.net/issues/show_bug.cgi?id=144
6) Use linear fog.

gmrolf
Offline
Joined: 2005-01-26

uhhps...hmm...OK I believe to
go directly to point 6... sad...
best thanks for that engraved answer!
best regrads
rolf