[Radiance-general] Stencil method to reduce light leaks from adjacent spaces

Thomas Bleicher tbleicher at arcor.de
Sun Mar 4 19:05:49 CET 2007

Hi John and Greg.

Thanks for sharing this tip. I tried it on a simple scene and it works
nearly out of the box:

> 	vwrays -ff -x 512 -y 512 -vf best.vf \
> 		| rlam -if6 - -if1 '\!pvalue -h -H -df -b stencil.pic' \
> 		| rcalc -if7 -of -e '$1=$1;$2=$2;$3=$3' -e 'out(v)=if($7-.5,v,0)' \
> 			-e '$4=out($4);$5=out($5);$6=out($6)' \
> 		| rtrace -ffc `vwrays -d -x 512 -y 512 -vf best.vf` -i scene.oct \
> 		> stencilled_ill.pic

I had to change the 'rlam' command in the second line to

	| rlam -if6 - -if1 '!pvalue -h -H -df -b stencil.pic' \

i. e. no backslash in front of the exclamation mark.

After that I created a view of the scene and a falsecolor image from the
illuminance picture and used pcomb to combine them:

pcomb -e 'ro=if(ri(1),ri(2),ri(3));go=if(gi(1),gi(2),gi(3));bo=if(bi 
(1),bi(2),bi(3))' \
       stencilled_ill.pic fc.pic scene.pic > combined.pic

This command uses the stencilled_ill.pic as a mask for the  
combination of the scene image
and the illuminance plot: where there is a bright pixel in the  
stencilled_ill.pic the value
of fc.pic is used, else it's the scene.pic. The result is a view of  
the scene with the
falsecolor workplane 'floating' in it. I'm sure there is a more elegant
way to do this but I'm happy with mine.

The only problem here is that pcomb requires images of equal size.  
While resizing
the background to the exact resolution of the mask image is no  
problem, the falsecolor
image can have no legend. If you want to create a combined image with  
falsecolor legend
you have to add a space to the left of the scene.pic and the  
before you combine the images.

If I can find some time I'll illustrate the whole process.


More information about the Radiance-general mailing list