POV-Ray : Newsgroups : povray.binaries.images : Isosurface self shadow? : Re: Isosurface self shadow? Server Time
9 Aug 2024 03:26:19 EDT (-0400)
  Re: Isosurface self shadow?  
From: Slime
Date: 10 Mar 2005 18:20:38
Message: <4230d646$1@news.povray.org>
OK. Here are some tips:

all_intersections (and you can remove max_trace since all_intersections
overrides it) slows things down significantly. I recognize that it can be
necessary when used in an intersection, but your intersections are simple
and they can be eliminated by either changing the isosurface functions (with
max(z, ...) and max(-z, ...)) or by using a box for contained_by which cuts
the isosurface off at the appropriate place. Then only the first
intersection of the isosurface needs to be found which speeds up the render.
I've used the former choice.

The agate function is being evaluated many times and is considerably slowing
things down, yet it only has a very slight effect on the surface. You can
remove it from the function and put it into a normal{} block instead, and
that will probably create almost exactly the same effect while making things
a lot faster. This also may let you decrease the max_gradients (I haven't
bothered to try).

Your contained_by object is a sphere which is much bigger than the object
itself (mostly in the vertical direction). You would probably benefit from
using boxes instead, using a separate, tighter one for each of your three
isosurfaces. (This also lets you remove the max() calls from the function
that I mentioned earlier.)

You can simplify your atan calls to atan2(x,abs(z))

After my changes - I'm not sure if they're what helped or not - I didn't
have any shadow problems with an accuracy of .0001.

union{
 #while (trn>0)
   isosurface{
    function{
     max (
      f_helix1 (f_r(x,y,z)-3, f_th(x,y,z), y, 4, 4, .05,
       #if (trn=2)
        -atan2(x,abs(z))/(2*pi)+(.5*trn-r)
       #else
        atan2(x,abs(z))/(2*pi)+(.5*trn-r)
       #end
       , 2, 0, 0
      )
      #if (trn=2)
       , -z
      #else
       , z
      #end
     )
    }
    contained_by{sphere{<0,0,0>,8}}
    #if(trn=1)
     max_gradient 15.0
    #end
    #if (trn=2)
     max_gradient 1.4
    #end
    #if(trn=3)
     max_gradient 3.4
    #end
    accuracy .0001
   }
  #local trn=trn-1;
 #end

 hollow
 pigment {rgb 1}
 /*finish{
  Phong_Shiny
  reflection{,1}
 }*/
 normal {
  agate .2
  scale .5
 }
}

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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