|
![](/i/fill.gif) |
Christoph Hormann wrote:
> Wolfgang Wieser wrote:
>> I am not completely sure about what I am talking here but at least
>> what I propose in the following lines removed black spots on the
>> isosurface of my Mars renderings. (These spots only occur when the light
>> comes under a flat angle and when no_shadow is NOT set.)
>>
>> [...]
>
> What you describe seems to be specific to shadow rays, does your
> suggested change also influence the appearance of the actual surface
> (i.e. camera rays). You could try rendering with a fairly large accuracy
> value for testing.
>
Well, in iso code there is no difference between viewing and shadow rays.
The in_shadow_test flag is never actually used except for some cache
which is handeled at a higher level and should not matter here.
What I describe seems to be specific to rays which come in a _very_
flat angle over the surface. And for these Mars renderings, the
shadow rays come really flat on the shadow side of hills.
> I agree with Thorsten that the interpolation will probably cause
> slowdown without much advantage
>
I am not sure about that. Because the gain in accuracy is considerably.
The original code will track the ray until its position is known to
be within "surface +/- accuracy". But with the modification I propose,
we gain significantly in accuracy because we can linarly interpolate the
"exact" location of the surface.
> (and i don't think the simple version
> you posted will work correctly in all situations).
>
You don't _think_ ...
Okay, I am not completely sure, too.
Actually,
--------------------------
if(EP2->f<=0.0)
{
double df = EP1->f-EP2->f;
// Need to calc (EP1->t*EP2->f - EP2->t*EP1->f) / df
// in a numerically stable way.
ISOSRF->tl = (df>1e-14) ?
EP2->t + t21*EP2->f/df :
0.5*(EP2->t+EP1->t);
return true;
}
return false;
--------------------------
should work as well (and does for my scenes). All the other conditions
are just to work around conditions which I am not sure about.
> Also note we are
> talking about differences of a maximum of accuracy*0.5.
>
So what?
Please see the following web page for a comparison:
http://www.cip.physik.uni-muenchen.de/~wwieser/tmp/poviso.html
Wolfgang
Post a reply to this message
|
![](/i/fill.gif) |