Dear all,

I've been re-reading some of the sections in RwR,
and started pondering about graphical methods which might
help in determining good settings for -av and -ad.

For demonstrating the concept, I've rendered some glow cups
into a simple test room. The cups form iso-elevation bands
in 10 deg steps that are all at the same distance from the
sensor position and are 2 deg wide. The blue band is at
elevation zero. Red ones are below the working plane, green
ones above it. This is an equiangular projection as seen
from the position of the sensor:

http://www.luxal.eu/pickup/images/cball_sensor.jpg

Here is my train of thought:

a) Stratified Monte-Carlo projection for -ad

ยทยทยท

============================================

When taking interior illuminance measurements, it's
important to make sure that all windows are hit by at least
one of the ambient sampling rays. When the windows are
fairly small and/or very far away, setting -ad appropriately
can be tricky. Raphael's tutorial, rc97tut.pdf on
on page 38 listing -ad against the required angular
resolution down to 1 degree.

I was wondering about a more visual approach to do this. The
ambient samples are not sent out with a cosine correction,
like an 'inverted' lux meter would do. Instead, a what is
termed stratified approach is taken which is essentially a
projection of the hemisphere onto the plane that ensures
each are of the projection is identical to every other area.
I'm not entirely sure if this can be called an 'equi-area
projection', but it probably can.

RwR, 2ed, pp. 536--537

To put this in other words: If we generate a special fisheye
view that has the same properties as the 'stratification
projection' employed by Radiance's Monte Carlo sampling, we
can visually judge if the image dimensions are sufficiently
large to ensure that even small window openings show up as
at least one bright pixel. The number of pixels in the
smallest image that allows us to see all of our small/far
away windows would then be the equivalent to the minimal
required -ad setting. Each ring in the image below has the
same area:

http://www.luxal.eu/pickup/images/cball_equiarea.jpg

Unlike the MC sampling that sends out the rays randomly
within each area of the stratified region, the rays in the
image do not have any jitter if we use a cal file and rtrace
to compute the view. This is because rtrace does not have
rpict's -pj option. For this reason, it's probably safe to
set the -ad to a little more than the number of pixels in

Furthermore, the sensor can only see above the working plane
and the corners of the fisheye projection would not
contribute to the ambient illuminance. Counting just the
pixels in the image would thus overestimate the required
samples: area_circle = 0.785 * area_square. We might use
this discrepancy as a safety margin.

# b) The crystal ball: Setting -av

RwR, 2ed, p 552, ch 12.2.1 Computing Indirect Irradiance:

"This ambient value is set by the -av option, given in units
of watts/steradian/m2. It corresponds to the average
radiance measured in all directions over the visible scene
(excluding light sources) and is used in place of a locally
computed average from hemisphere samples."

This again appears to be the job for a special projection.
This time, what we need is an 'equi-solid-angle' projection
of the sphere. Because we don't want 'dead' corners in the
projection, we'll project onto a cylinder.

http://www.luxal.eu/pickup/images/cball_equisolidangle.jpg

Ensuring that all our windows are accounted for (see a)
above), we can simply render an image with this projection,
and let pvalue and total work out the average. It's
probably a good idea to take the weighted average of R,G,B
to avoid any colour cast. We place the crystal ball in the
corner of the room this is furthest away from any window.

It is also important to exclude any direct light sources
that might be visible, so we set -dv-.

This, I believe, should produce good ambient value for the
scene.

Does this all make sense?

Cheers

Axel