# rtcontrib parameter settings

**URL:** <https://discourse.radiance-online.org/t/rtcontrib-parameter-settings/4184>\
**Category:** radiance-general\
**Created:** [July 17, 2007, 10:13am UTC](https://discourse.radiance-online.org/t/rtcontrib-parameter-settings/4184 "2007-07-17T10:13:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy\_Stone](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@Andy\_Stone](https://discourse.radiance-online.org/u/Andy_Stone)\
**Post date:** [July 17, 2007, 10:13am UTC](https://discourse.radiance-online.org/t/rtcontrib-parameter-settings/4184/1 "2007-07-17T10:13:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [July 25, 2007, 5:23am UTC](https://discourse.radiance-online.org/t/rtcontrib-parameter-settings/4184/2 "2007-07-25T05:23:07Z")

</div>

Hi Andy,

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

> From: "Andy Stone" \<andy.stone@bdsp.com\>  
> 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 \  
&nbsp;&nbsp;\> rtcontrib -V+ -o solar\_coefficients16.bin \  
&nbsp;&nbsp;-M sun\_modifiers.txt -fad -ab 5 -ad 4096 -lw 1e-8 -I+ -h \  
&nbsp;&nbsp;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 \  
&nbsp;&nbsp;\> rtcontrib -V+ -o '!total -m -id -16 -od \> solar\_coefficients.bin' \  
&nbsp;&nbsp;-M sun\_modifiers.txt -fad -ab 5 -ad 4096 -lw 1e-8 -I+ -h \  
&nbsp;&nbsp;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\](http://www.cygwin.com/cygwin-ug-net/setup-maxmem.html%5C)) 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

---

<div class="post-metadata">

**Author:** ![Andy\_Stone](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@Andy\_Stone](https://discourse.radiance-online.org/u/Andy_Stone)\
**Post date:** [August 2, 2007, 5:03pm UTC](https://discourse.radiance-online.org/t/rtcontrib-parameter-settings/4184/3 "2007-08-02T17:03:21Z")

</div>

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 \  
> > &nbsp;&nbsp;\> rtcontrib -V+ -o solar\_coefficients16.bin \  
> > &nbsp;&nbsp;-M sun\_modifiers.txt -fad -ab 5 -ad 4096 -lw 1e-8 -I+ -h \  
> > &nbsp;&nbsp;octrees/scene\_with\_suns.oct  
> > total -m -id -16 -od solar\_coefficients16.bin \> solar\_coefficients.bin  
> > rm solar\_coefficients16.bin

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [August 4, 2007, 1:24am UTC](https://discourse.radiance-online.org/t/rtcontrib-parameter-settings/4184/4 "2007-08-04T01:24:17Z")

</div>

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

-Greg

> **···**
>
> > From: "Andy Stone" \<andy.stone@bdsp.com\>  
> > 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 \  
> > > &nbsp;&nbsp;\> rtcontrib -V+ -o solar\_coefficients16.bin \  
> > > &nbsp;&nbsp;-M sun\_modifiers.txt -fad -ab 5 -ad 4096 -lw 1e-8 -I+ -h \  
> > > &nbsp;&nbsp;octrees/scene\_with\_suns.oct  
> > > total -m -id -16 -od solar\_coefficients16.bin \> solar\_coefficients.bin  
> > > rm solar\_coefficients16.bin
