rtcontrib parameter settings

Hi all,

I've been using rtcontrib recently and I'm having problems finding a set
of rendering parameters (ad and lw) that don't give "out of memory"
errors but do give sufficiently accurate results.

About the highest settings that I can use before an out of memory error
occurs is:

cat luxmeters_test_office.txt | rtcontrib -V+ -o solar_coefficients.bin
-M sun_modifiers.txt -fad -ab 5 -ad 4096 -lw 1e-8 -I+ -h
octrees/scene_with_suns.oct

...but when I use these settings the results contain a lot of noise.

The scene consists of a fairly complex building and 72 light sources
(representative suns for the year), each of which has a unique modifier
so that I get a coefficient for each light source at each measurement
point.

So far I've come up with two possible explanations for my problems:

1. I'm getting my settings all wrong. I'm using -ad and -lw to control
the accuracy, but I haven't got a good feel for how to vary them -
should I set -ad as I would for a normal rtrace-type calculation and
then reduce lw until I get what I want, or does ad need to be higher for
an rtcontrib type calculation? Or is there another setting I need to
look at?

2. I'm using cygwin. Is anyone aware of any memory limitations with
cygwin? I've seen the web page about increasing the memory available to
cygwin (http://www.cygwin.com/cygwin-ug-net/setup-maxmem.html) and that
didn't help at all - apparently cygwin on my machine has a maximum heap
size of about 1.5Gb.

Does anyone have any suggestions?

Thanks,

Andy Stone

Hi Andy,

Looks like this one slipped through the cracks during my absence as well. Not too surprising, considering the subject...

From: "Andy Stone" <[email protected]>
Date: July 17, 2007 12:13:21 PM GMT+02:00

Hi all,

I've been using rtcontrib recently and I'm having problems finding a set
of rendering parameters (ad and lw) that don't give "out of memory"
errors but do give sufficiently accurate results.

About the highest settings that I can use before an out of memory error
occurs is:

cat luxmeters_test_office.txt | rtcontrib -V+ -o solar_coefficients.bin
-M sun_modifiers.txt -fad -ab 5 -ad 4096 -lw 1e-8 -I+ -h
octrees/scene_with_suns.oct

...but when I use these settings the results contain a lot of noise.

Individual source values/images from rtcontrib often do contain a lot of noise, which is reduced when you sum several sources together as is normally done in a daylight coefficient method, but more problematic for sun sources. (By the way, using the -V+ option shouldn't be necessary in this case.)

A funny trick you can try is using multiple identical calculations then averaging the result into your output file. I recommend doing this in two steps, so you can recover the run if you have to. The following would take 16 samples at each illuminance point and average them together to reduce noise by a factor of 4:

sed -n 'p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p' pluxmeters_test_office.txt \
  > rtcontrib -V+ -o solar_coefficients16.bin \
  -M sun_modifiers.txt -fad -ab 5 -ad 4096 -lw 1e-8 -I+ -h \
  octrees/scene_with_suns.oct
total -m -id -16 -od solar_coefficients16.bin > solar_coefficients.bin
rm solar_coefficients16.bin

Or, you can put everything in one command if you're feeling brave and want to save time & file space:

sed -n 'p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p' pluxmeters_test_office.txt \
  > rtcontrib -V+ -o '!total -m -id -16 -od > solar_coefficients.bin' \
  -M sun_modifiers.txt -fad -ab 5 -ad 4096 -lw 1e-8 -I+ -h \
  octrees/scene_with_suns.oct

Note that C-shell users will have to add a backslash ('\') before the exclamation mark ('!') in the -o option of rtcontrib.

I should probably build this trick straight into rtcontrib, as I've used it myself to good effect.

The scene consists of a fairly complex building and 72 light sources
(representative suns for the year), each of which has a unique modifier
so that I get a coefficient for each light source at each measurement
point.

So far I've come up with two possible explanations for my problems:

1. I'm getting my settings all wrong. I'm using -ad and -lw to control
the accuracy, but I haven't got a good feel for how to vary them -
should I set -ad as I would for a normal rtrace-type calculation and
then reduce lw until I get what I want, or does ad need to be higher for
an rtcontrib type calculation? Or is there another setting I need to
look at?

By default, rtcontrib uses Russian roulette to avoid the usual bias in Monte Carlo ray-tracing, but it does come at the cost of higher noise levels. I wouldn't know what other parameters to suggest you fool with, either.

2. I'm using cygwin. Is anyone aware of any memory limitations with
cygwin? I've seen the web page about increasing the memory available to
cygwin (http://www.cygwin.com/cygwin-ug-net/setup-maxmem.html\) and that
didn't help at all - apparently cygwin on my machine has a maximum heap
size of about 1.5Gb.

I can't really help you there, but perhaps someone else has a suggestion for the cygwin memory issue.

-Greg

Hi Greg,

Thanks for the advice - it's sorted out my problem. The only slight
change that I made to the commands that you suggested was in the total
command I added 216 after the -id option (since I have 72 modifiers * 3
colour channels=216 columns in the file):

total -m -id216 -16 -od solar_coefficients16.bin >
solar_coefficients.bin

Thanks,

Andy

···

A funny trick you can try is using multiple identical calculations
then averaging the result into your output file. I recommend doing
this in two steps, so you can recover the run if you have to. The
following would take 16 samples at each illuminance point and average
them together to reduce noise by a factor of 4:

sed -n 'p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p' pluxmeters_test_office.txt \
  > rtcontrib -V+ -o solar_coefficients16.bin \
  -M sun_modifiers.txt -fad -ab 5 -ad 4096 -lw 1e-8 -I+ -h \
  octrees/scene_with_suns.oct
total -m -id -16 -od solar_coefficients16.bin > solar_coefficients.bin
rm solar_coefficients16.bin

Good catch. I think -id3 would work just the same, and save memory, but what you have is fine.

-Greg

···

From: "Andy Stone" <[email protected]>
Date: August 2, 2007 10:03:21 AM PDT

Hi Greg,

Thanks for the advice - it's sorted out my problem. The only slight
change that I made to the commands that you suggested was in the total
command I added 216 after the -id option (since I have 72 modifiers * 3
colour channels=216 columns in the file):

total -m -id216 -16 -od solar_coefficients16.bin >
solar_coefficients.bin

Thanks,

Andy

A funny trick you can try is using multiple identical calculations
then averaging the result into your output file. I recommend doing
this in two steps, so you can recover the run if you have to. The
following would take 16 samples at each illuminance point and average
them together to reduce noise by a factor of 4:

sed -n 'p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p' pluxmeters_test_office.txt \
  > rtcontrib -V+ -o solar_coefficients16.bin \
  -M sun_modifiers.txt -fad -ab 5 -ad 4096 -lw 1e-8 -I+ -h \
  octrees/scene_with_suns.oct
total -m -id -16 -od solar_coefficients16.bin > solar_coefficients.bin
rm solar_coefficients16.bin