POV-Ray : Newsgroups : povray.advanced-users : Isosurface speed : Re: Isosurface speed Server Time
6 Oct 2024 15:18:56 EDT (-0400)
  Re: Isosurface speed  
From: Mark Weyer
Date: 13 Sep 2006 09:50:00
Message: <web.45080b8cf7b7b54cfddaa4670@news.povray.org>
> However, since it's the isosurface of a 18th degree polynomial, I've had
> to set max_gradient=exp(18) to get it to render correctly.

Povray isosurfaces are fastest when the actual gradient does not differ
too much from maxgradient. Therefore I always try to code isosurface
functions such that their value is the actual distance from the surface.
Of course in general this is only approximately and/or locally true.

In your case I would basically wrap an 18th root around the function.
(Still you have to take some care as to small and negative values.
Assuming a threshold of 1 you could wrap pow(max(1/2, ... ),1/18).)
Of course this is similar to your own idea of wrapping a logarithm.


> And so, I've been sitting here thinking about all the ways POV-Ray could
> arrive at its result faster. The trouble is, I can think of quite a few
> that would work for *this* shape, but would fail in special cases. It
> just so happens that the shape I'm trying to trace has a huge max
> gradient, but is actually a very simple shape.

We all learned at school how to build derivatives of functions. In fact
this was an algorithm on the symbolic representation of the functions
(as opposed to numerics) and could be incorporated into povray (Maybe
except for some inbuilt pattern functions, I don't know about those...).
So instead of assuming the gradient to be maxgradient, the isosurface
algorithm could compute the actual gradient. Of course, in order to know
how far this computed gradient can be trusted, the *second* derivative
must be bounded or computed. And if it is computed, we need to know a
bound or compute the third, and so on. So this would amount to defering
the maxgradient specification until some later derivative which hopefully
does not change too much. In your case that would be the 18th deriviative
with a bound of 0.

I am unsure though, if this actually has merits: With multiplications the
derivatives can be a lot more lengthy than the original function. Also,
as the functions depend on 3 variables, there are 3^n derivatives of
order n to be considered. This can get out of hand rather faster than it
has any benefits.

  Mark Weyer


Post a reply to this message

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