1 |
greg |
1.2 |
{ RCSid $Id$ } |
2 |
greg |
1.1 |
{ |
3 |
|
|
BAD fog simulation effect using a converted z-file, eg: |
4 |
|
|
|
5 |
|
|
pvalue -r -df -b -h `getinfo -d < scene.pic` scene.z | \ |
6 |
|
|
pcomb -e VIS:20 -f fog.cal scene.pic - > foggy.pic |
7 |
|
|
|
8 |
|
|
The constant VIS must be set to the visibility distance, |
9 |
|
|
ie. the distance at which half the contrast is lost. |
10 |
|
|
|
11 |
|
|
Substitute a local brightness model for fog_v to improve |
12 |
|
|
the effect. |
13 |
|
|
} |
14 |
|
|
|
15 |
|
|
dist = gi(2); { distance given by second file } |
16 |
|
|
|
17 |
|
|
fog_v : .5; { fog particles are uniform grey } |
18 |
|
|
|
19 |
|
|
prob = 1 - 2^-(dist/VIS); { probability of intercepting fog particle } |
20 |
|
|
|
21 |
|
|
fog(v) = prob*fog_v + (1-prob)*v; |
22 |
|
|
|
23 |
|
|
ro = fog(ri(1)); |
24 |
|
|
go = fog(gi(1)); |
25 |
|
|
bo = fog(bi(1)); |