POV-Ray : Newsgroups : povray.programming : Radiosity code question #3 : Re: Radiosity code question #3 Server Time
28 Jul 2024 08:27:23 EDT (-0400)
  Re: Radiosity code question #3  
From: Jim McElhiney
Date: 25 Jun 2003 10:47:34
Message: <3EF9B5F5.C5C7EF56@excite.com>
Christoph Hormann wrote:

> Does anyone know about the importance of the SIGMOID_METHOD/SAW_METHOD
> switch in 'radiosit.cpp', line 432:

Hi, Jim here.
I actually wrote the offending line of code.

Here's what it means:
When the global illumination samples are reused, several are
put together in a weighted average.  The weights are inversely proportional
to the estimated error of each sample.  One of the factors governing
the estimated error is how far away it is.  So, as you move away
from a point, the error estimate goes up, and the weight of that
sample in the average is gradually reduced.  So, the question is,
HOW does the weight vary with distance?
In Greg Ward's original 1998 Siggraph paper, the weight was
the inverse of the estimated error.  The estimated error was given
as zero at a zero distance from the sample, which gave an infinite
weight, which I found (if few samples were included in the average)
gave the problem of sudden changes in the value.  So, I roll off the
weight more gradually.  The saw method makes the effective
area like a cone  (a zigzag in section, hence the name):  highest
at the old sample location, falling off linearly with distance.
This still gives a discontinuity in the weight at the old sample point,
suddenly changing from rising weight to falling weight.  I was seeing
some artefacts that seemed like they might have come from this
effect, so I added the option of the sigmoid weighting.  (sigmoid
simply means S-shaped).  The weight follows a cosine shape:
higest at the old sample point, rolling off very slowly at first,
then falling faster, then falling slowly again as the weight approaches
zero.  In the end, I don't think it matters very much which you use:  by far
the
biggest factor in blotchiness (the bane of the radiosity fan) is
how many samples are included in the average, not the rate
of change of the weights.
One exception:  I've been finding, tracking down, and very slowly
fixing a few bugs that caused discontinuities in the average.  However,
these are caused by old samples not being included in the average,
then being included on the next pixel, and jumping in with a noticeable
weight.  Again, this isn't fixed by the sigmoid or saw method, although
there is a possibility that the sigmoid might be a whisker better,
since it has an outer border area of very low, slowly changing weight around
each point.

Jim


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.