x


In what units is fog density expressed?

What formula correlates the camera's view distance to a particular fog density?

more ▼

asked Dec 08 '09 at 05:20 PM

Aubrey Falconer gravatar image

Aubrey Falconer
657 45 53 68

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

I imagine these are the same as the old fixed function OpenGL pipeline, which I believe are as follows:

Linear: f = inverse_lerp(fog_start_distance, fog_end_distance, distance)
Exp:    f = exp(-fog_density * distance)
Exp2:   f = exp(-(fog_density * distance) ^ 2)

f = clamp(f, 0.0, 1.0)

C = f * Cr + (1.0 - f) * Cf

where:
f is fog factor
C is resulting fragment color
Cr is original fragment color
Cf is fog color
more ▼

answered Mar 26 at 02:42 PM

Matthew A gravatar image

Matthew A
502 7 9 18

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2987
x1650
x86
x20

asked: Dec 08 '09 at 05:20 PM

Seen: 2134 times

Last Updated: Mar 26 at 02:44 PM