ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/fog.cal
Revision: 1.1
Committed: Sat Feb 22 02:07:21 2003 UTC (21 years, 1 month ago) by greg
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

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