[Radiance-general] splitting a render by light sources

Thomas Bleicher tbleicher at arcor.de
Sat Jan 14 20:55:57 CET 2006


On 14.01.2006, at 16:23, william reynolds wrote:

> hi there
> i'm fairly new to the radiance package, and to rendering in
> general, but i have a fairly specific project on the go, with
> which i need some help.
>
> i am trying to use radiance to render a relatively simple model
> geometrically - just a simple room, with a box sitting on the
> floor - but with up to 100 or so light sources. but the difference
> is that i want to get a separte image file for each light
> source - i.e.  hundred or so images, with only 1 light on in each.
> i will then use superposition and recombine the images later,
> allowing me to vary the intensities of each light source.

I hope you are aware of the fact that a incandescent light source
will have a shift of the spectrum in it's output when you change
the intensity (reduce the power for the lamp). But I don't think
you're bothered about this (small) aspect, so let's move on.

> is there any kind of built in functionality in radiance to
> allow me to do this, or do i have to write a shell script or
> something (and if so, can anyone point me towards a good place
> to learn how! i come from a very winndows based background)

The "build in functionality" of Radiance is it's simplicity.
Small tools for small tasks. And yes, you will have to write
a script for your problem. But it will be a simple script.

First you have to organize your scene data:

a) everything that is static in the scene in one file
b) a bunch of files containing everything that isn't
    (in your case 100 files with the description of 1 light
     source each).
c) definitions of i.e. viewpoints or render parameters

The basic steps to create one image are:

1) Compile a scene octree from the static and one dynamic file
2) Render the image with the created octree as input

I don't know much about your light so I assume you have
created a "static.rad" file, 100 "dynamic.001" etc. files
and a file with render options "render.opt".

Creating your images is as simple as:

for i in `seq -w 100`
do
   oconv static.rad dynamic.${i} > tmp_scene.oct
   rpict @render.opt tmp_scene.oct > image_${i}.pic
done

Not as bad as it sounds, eh?

There is plenty of room for improvements: in particular, you don't
need all the 100 files for light sources if the vary only in
position or in other small details. That could be done within
the "for ..." loop, too. All depends on your needs.


For a simple introduction to bash google for "bash tutorial"
and try a few of the hits. It depends on you what's the right
introduction level. You can use any other scripting language
as well (Python, Perl, TCL) if you already know one.


HTH,
Thomas





More information about the Radiance-general mailing list