ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/fog.cal
Revision: 1.2
Committed: Wed Nov 21 18:10:45 2018 UTC (5 years, 5 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R3, HEAD
Changes since 1.1: +1 -0 lines
Log Message:
Added missing RCSid tag

File Contents

# User Rev Content
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));