POV-Ray : Newsgroups : povray.beta-test : v3.8 Clean up TODOs. Add jitter to isosurface. : v3.8 Clean up TODOs. Add jitter to isosurface. Server Time
4 Dec 2023 00:33:48 EST (-0500)
  v3.8 Clean up TODOs. Add jitter to isosurface.  
From: William F Pokorny
Date: 20 Apr 2020 05:31:14
Message: <5e9d6be2$1@news.povray.org>
Today, it can be nearly impossible to eliminate some isosurface accuracy 
artifacts no matter how small accuracy. The issue most often comes up 
with shadows and is related to issues with the internal hard coded 
shadow tolerance and shadow ray treatment.

Perhaps the simplest set up for demonstrations is a f_sphere() sphere a 
light and an orthographic camera.

In povr I've deleted the new to v38 isosurface polarity convenience 
feature(1) which was costing around 1% at scene with simpler functions.

Used the 1% from above to add the conditional for a new jitter feature 
for isosurfaces. It is just on or off and when on it jitters the 
accuracy value on each recursive solver descent by +-0.5 * 
(accuracy*0.96...7) which in testing ranges of jitter seems to work 
well. We'll see. Default is off so nothing changes unless it's turned on.

Image attached - and yes it was scaled down for size making the defects 
sometimes harder to see.

Some timing data below too. With jitter and AA you end up slower and 
faster - just depends.

Aside 1: Unsure whether it will be useful or not, but the jitter does 
slightly roughen the final surface. Might it be useful for surface 
effects? Blurred reflections of a sort?

Aside 2: On my list to bring out the shadow_tolerance as a global 
setting. Being able to twiddle with it can often fix see through opaque 
shape issues when the intersection depth is < the shadow tolerance. 
There is a core issue shadow ray issue no matter. One which can be fixed 
for many cases, but it's a relatively big job that's tangled with the 
shadow cache mechanism.

Bill P.

(1) - Polarity is/was an option not strictly necessary. There is too the 
question of whether grabbing the potential through an isosurface makes 
sense when you can - and probably should - work with the input function 
directly to get the 'potential' / the function values.

Timing results. Conditions slightly different than attached image.

--- Adaptive jitter
accuracy 0.0005 max_gradient 1.1
povr2 tmp.pov +w900 +h900 +a0.1 +am2 +r4 +p
24.142 -> 23.519   -2.58%
     tmpAM2_00j_a01_R4    24.142
     tmpAM2_09j_a01_R4    23.519  (Vastly better result and faster)
accuracy 0.0001 max_gradient 1.1 (No AA hard-ish to see circles)
povr2 tmp.pov +w900 +h900 +a0.1 +am2 +r4 +p
16.606 -> 19.020  +14.54%
     tmpAM2_00j_a01_R4a   16.606s
     tmpAM2_09j_a01_R4a   19.020s (Harder to see but better at a cost)

--- Fixed jitter to hard depth.  A render large and shrink approach.
accuracy 0.0005 max_gradient 1.1
povr2 tmp.pov +w900 +h900 +a0.0 +am1 +r6 +p
184.142 -> 186.095   +1.06%
     tmpAM1_00_R6.png  184.142
     tmpAM1_09_R6.png  186.095   (Faint circles gone at some cost)
accuracy 0.0001 max_gradient 1.1
211.89 -> 208.349    -1.67%
     tmpAM1_00_R6a.png  211.890  (No circles either case. In jitter
     tmpAM1_09_R6a.png  208.349  case get more feathered shadow as if
                                 surface has the slightest roughness)

Post a reply to this message

Download 'storyisojitter.png' (173 KB)

Preview of image 'storyisojitter.png'


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