en it

Rendering images with depth of field

From the post “Depth-of-field hack” in Radiance-General by Mark Stock
[ Mon Aug 16 19:30:29 CEST 2004 ]

vwrays -fd -vf vp -x 512 -y 512 | rcalc -id6 -e ‘a:0.003;d:0.4’
-e `vwright i < vp`
-e ‘theta=2*PI*rand(2*recno-1);r=0.5*a*sqrt(rand(2*recno))‘
-e ‘r1=r*cos(theta);r2=r*sin(theta)‘
-e ‘dx=r1*ihx+r2*ivx;dy=r1*ihy+r2*ivy;dz=r1*ihz+r2*ivz’
-e ‘$1=ipx+dx;$2=ipy+dy;$3=ipz+dz’
-e ‘$4=$4-dx/d;$5=$5-dy/d;$6=$6-dz/d’
-od | rtrace -fdc -x 512 -y 512 @opts scene5f.oct > img04.pic 1)

The “a:0.003;d:0.4” line specifies aperture and focus distance.
The “vp” file looks like this:
rview -vta -vp 0.51 0.52 0.34 -vd -0.43427 -0.86854 0.238848 -vu 0 0 1 -vh 70 -vv 70 -vo 0 -va 0 -vs 0 -vl 0
The opts file looks like this:
-ab 2 -ad 4 -aa 0 -as 0 -dj 0.7 -ms 0.03
The resolution gets specified in two places on the command-line.

1) everything goes in one line
rendering_images_with_depth_of_field.txt · Last modified: 2008/02/29 16:32 by santiago
Recent changes · Show pagesource · Login