radiance graph

Hi,

Currently I'm trying to construct a light-graph of a given scene by
raytracing Radiance samples using rtrace, and dumping these to a polyline
instead of pixels. I think such a graph could give a lot of insight apart
from an image as well. Also I like the idea of being able to construct
geometry instead of generating yet another pixel. I already have sooo many
of these.

Thing is that my experiment has only been semi successful, and I'd like to
hear what you think of it: I've made it available on my server:
www.ezct.net/radiance

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

The coordinates in raytrace_sample.dmp are converted to .dxf geometry.
To give you some insight, I've merged it with the original scene:
radiance_graph_01_in_context.dxf

The problem so far is that 'graph' implies clarity, and as you'll see, my
experiments so far are rather noisy. Getting lots of rays isn't the point,
getting the ones that matter is another! The other thing is that I do not
know how I could generate such a point dump from a whole image instead of
sampling a single pixel, as I'm doing now. I've done some experiments
sampling many points, but that's not the way to do it. How could I have
rtrace trace all pixels in a given picture?

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?

Another thing would be that the graph would be most coherent when a ray is
traced from camera all the way to the source. Would my best option be to
render with just a sun and to forget about the sky? I've tried a couple of
option but it seems difficult to have many rays reach a light source.

Love to hear what you think of it.

Cheers,

Jelle.

Hello,

A few years ago I did similar things as you are doing. Here are some advices you may find useful:

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
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

ยทยทยท

At 11.03.2005 15:35, you wrote:

Sorry I made a mistake in the last line of my previous message:

Here is the right formula:

rtrace -otodpv... | rcalc -e 'n=log($10)/log(0.9); ... '

Raphael Compagnon