POV-Ray : Newsgroups : povray.binaries.images : Iso floor grow (46Kbu) : Re: Iso floor grow (46Kbu) Server Time
19 Aug 2024 16:21:53 EDT (-0400)
  Re: Iso floor grow (46Kbu)  
From: Mike Williams
Date: 10 Nov 2000 17:19:44
Message: <+cWYoAAcCHD6Ew+f@econym.demon.co.uk>
Wasn't it Andy Cocker who wrote:
>Hi,
>
>Just another experiment, posted because I have a couple of questions.
>
>a) The code for each isosurface is:
>#declare F = function { pigment { crackle form <1,0,0> color_map { [0.0 rgb
>0.0 ] [1.0 rgb 1 ] } scale 1/2 }}
>
>#declare Gloop=
>    isosurface{
>      function { x^2+y^3+z^2+F-1 }
>      contained_by{ box { -2.1, 2.1 } }
>      max_gradient 14
>      accuracy 0.001
>}
>
>I notice that one of the isos has a strange line on its base. How would I
>get rid of this? I already changed accuracy and max_gradient, and got rid of
>many more errors, but the rendering takes too long on my p200.

I don't know how to fix the line (I can't reproduce it) but I can speed
it up by a factor of more than 2. 

The trick is to notice that isosurfaces can render faster when the
contained_by surface is a reasonably close fit, and can render slowly if
the fit is loose. I guess that's partly because the code starts from the
point where the ray intersects the contained_by shape and then starts
hunting up and down the ray looking for the actual surface.

In this case, your Gloop shape doesn't fit at all neatly into a single
box or a single sphere, but we can cut it up into two pieces, each of
which fit reasonably neatly into smaller boxes.

There are a couple of side effects. Firstly we have to bump up the
accuracy, otherwise the join becomes visible (the slight speed penalty
caused by increasing the accuracy is insignificant compared to the time
saved). Secondly, the max_gradients of the pieces are lower than that of
the original isosurface, presumably the high gradient areas were in the
upper corners of the original contained_by box.

It may even happen that the significant increase in accuracy that you
can now use, in half the rendering time, might possibly get rid of the
strange line.

#declare F = function { pigment { crackle form <1,0,0> color_map { [0.0
rgb 0.0 ] [1.0 rgb 1 ] } scale 1/2 }}

#declare Gloop2=
  union {
    isosurface{
      function { x^2+y^3+z^2+F-1 }
      contained_by{ box { -1, 1 } }
      max_gradient 6
      accuracy 0.000001
    }
    isosurface{
      function { x^2+y^3+z^2+F-1 }
      contained_by{ box { -2.1, <2.1,-0.8,2.1> } }
      max_gradient 12
      accuracy 0.000001
    }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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