POV-Ray : Newsgroups : povray.beta-test : v3.8 Clean up TODOs. New shadow_tolerance keyword. : v3.8 Clean up TODOs. New shadow_tolerance keyword. Server Time
18 Apr 2024 00:49:45 EDT (-0400)
  v3.8 Clean up TODOs. New shadow_tolerance keyword.  
From: William F Pokorny
Date: 22 Apr 2020 13:50:52
Message: <5ea083fc$1@news.povray.org>
It's the case today, when during shadow ray tracing the intersection 
depth is less than an internal shadow tolerance (SHADOW_TOLERANCE) of 
1e-3, POV-Ray ignores opaque intersections and sees through to the light 
source.

The tolerance exists because we often need to ignore same shape close 
intersections in shadow ray tracing either because we are picking up the 
same shape on surface intersection again due numerical issues, the 
surface is noisy and nearly parallel to the ray, or, the surface has a 
problematic curvature for shadow ray tracing.

In povr I'm adding a new shadow_tolerance keyword to the global_settings 
block which allows the shadow tolerance to be adjusted scene to scene. I 
think such a new keyword a good idea for any eventual v3.8 release 
baring better fixes.

The keyword often enough to get around shadow ray, see through issues. 
Longer term we need to figure out better ways to sort the shadow ray 
tracing for these extremely close intersections. (Shadow tracing opaque 
objects in the opposite direction a good start. Always, or upon tripping 
the shadow tolerance intersection skip.)

Attached is an isosurface scene using the new to povr f_mult1to8pairs to 
do a difference between two spheres. The smaller cutting into the larger 
while using a small value burn off to get rounded edges.

Straight up with a larger accuracy setting you get rings artefacts (not 
shown). The traditional way to try and solve this is to crank down on 
the gradient and the accuracy. Taking the accuracy to 0.0001 in this 
scene and we suddenly get a bright arc where there should be shadow. 
What is happening is the inside curvature is 'inconvenient' for the 
shadow ray tracing given the usual 1e-3 shadow tolerance.

In the middle image we use: global_settings { shadow_tolerance 1e-5 } 
and, presto, we get the correct result. The difference image on the 
right uses a multiplier of 3x to make the differences a little easier to 
see.

Bill P.

Aside: And the trouble makers amoung us are thinking about other ways 
the existing see through issue on shadow testing can corrupt results in 
subtle ways... :-)

Aside 2: I've been running with 1e-5 in povr for a while with the solver 
branch fixes. It's a better default. A few sor and lathe test scenes 
with near orthographic angles and the shipped cornell.pov scene are the 
only places where 1e-5 has been too small. If you have the other fixes 
to run at 1e-5, it fixes most all the scenes people have posted over 
time with bright speckles caused by the shadow ray see through issue/bug.


Post a reply to this message


Attachments:
Download 'story_shadow_tolerance.png' (73 KB)

Preview of image 'story_shadow_tolerance.png'
story_shadow_tolerance.png


 

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