POV-Ray : Newsgroups : povray.general : Constructing isosurface functions : Re: Constructing isosurface functions Server Time
29 Jul 2024 12:29:50 EDT (-0400)
  Re: Constructing isosurface functions  
From: David Given
Date: 17 Jul 2011 20:00:49
Message: <4e2377b1$1@news.povray.org>
On 17/07/11 13:01, Christian Froeschlin wrote:
[...]
> well the reason I said that was tricky is because I didn't
> see the solution either ;) Basically you need a noise function
> that is constant over intervals, such as cells, but then marry
> it to the periodic function in such a way that the jumps will
> never split an object.

I managed radial spikes by using a bumps in polar coordinates, using a
colormap to take only the very tips, and then stretchin infinitely in
the r direction; after much fiddling I managed to clip it at 200m above
the terrain (big trees). The results look promising:

http://twitpic.com/5rt3z5/full

...but in order to make it render at all I had to use max_gradient of
1e5 and accuracy of 1e-3. As a result that measly, non-antialiased,
non-radiosity, 320x240 image took 3 hours 45 minutes to render. That's
not a success, to my mind.

My actual isosurface function is:

#local Spikes_Density = 64000;
#local Tree_Height = 0.2;
#local Spikes =
  function
  {
    max(
      f_bumps(f_th(x, y, z)*Spikes_Density, 0, f_ph(x, y,
z)*Spikes_Density) - 0.2,
      f_r(x, y, z) - (1+Tree_Height*km)*Moon_Altitude(x, y, z)/Lunar_Sphere
    )
  }

(Lunar_Sphere is the radius of my terrain isosurface container. km is a
scaling factor mapping from kilometres to 0..1 radius of that container.)

No doubt the function could be hugely improved --- using a pigment
rather than doing it in code would probably be faster --- but I suspect
the real pain is just because my isosurface is so insanely complicated
and so *huge*. The floating balls image I posted early had much smaller
gradients.

Are there any alternate approaches that are plausible? Could I achieve a
similar effect using a media density function, for example?

[...]
> Note the use of warp {spherical} in the spiked planet example
> I posted here earlier, it might help for some cases.

The big problem I have with spherical warps (and manual polar coordinate
conversions as above) is the distortion I get around the poles. There
must be a function somewhere that produces random spikes radiating out
from a centre; can't find it, though...

-- 
┌─── dg@cowlark.com ─────
http://www.cowlark.com ─────
│
│ "I have a mind like a steel trap. It's rusty and full of dead mice."
│ --- Anonymous, on rasfc


Post a reply to this message

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