[Radiance-general] radiance graph
Raphael Compagnon
raphael.compagnon at eif.ch
Fri Mar 11 16:50:24 CET 2005
Hello,
A few years ago I did similar things as you are doing. Here are some
advices you may find useful:
At 11.03.2005 15:35, you wrote:
>The technique I used is simple, I have been using the following commandline:
>
>ximage trace.pic | rtrace -ab 1 -ds 0.2 -dr 6 -dt 1 -otodp -h -x 1 -i
>ok.oct > raytrace_sample.dmp
You may have noticed that rays which are directed towards source objects
(e.g. the sky hemisphere) get point coordinates that are in fact the origin
(0,0,0). This leads to many rays wrongly directed to the origin instead of
going in the right direction. The solution I found is to filter the rtrace
output just to ignore these rays. This can be done using rcalc like this:
ximage trace.pic | rtrace -ab 1 -ds 0.2 -dr 6 -dt 1 -otodp -h -x 1 -i
ok.oct | \
rcalc -e 'abs(x)=if(x,x,-x);cond=abs($7)+abs($8)+abs($9)' > raytrace_sample.dmp
>To make the graph more clear, it would be interesting to color them for
>instance accordingly to how often a ray bounced. What would be a good way
>for scripting rtrace such that I'll be able to do so?
I just outline herefater a technique that works for a scene with opaque
diffusers only. You may also adapt this technique to other type of materials.
First define a new plastic with a .9 reflectance:
void plastic new_mat
0
0
5 .9 .9 .9 0 0
Then apply this new material to your scene file:
pfilt -m new_mat original_scene.rad >new_scene.rad
Alter also all light emitting types (i.e. glow, light, illum) of your scene
so that their R,G,B values are 1
By doing so the radiance values that is attached to a single ray will be
0.9^n with n the number of bounces it has encoutered.
Then add to your rtrace output the value of each rays using option -otodpv
(this last v is the thing you need!)
The output of rtrace can then be processed using rcalc to retrieve the
number of bounces n that you may then use to whatever you need:
rtrace -otodpv... | rcalc -e 'n=$10/log(0.9); ... '
Raphael Compagnon
More information about the Radiance-general
mailing list