POV-Ray : Newsgroups : povray.off-topic : Hello again : Re: Hello again Server Time
19 Jul 2024 23:34:30 EDT (-0400)
  Re: Hello again  
From: Le Forgeron
Date: 6 Jul 2015 07:58:11
Message: <559a6d53$1@news.povray.org>
Le 06/07/2015 10:47, scott a écrit :
>> No.
>>
>> As you'll recall, you have to specify the max_gradient for a POV-Ray
>> isosurface. That means that if you evaluate the function at a specific
>> point, based on the maximum gradient you can compute a sphere of maximum
>> radius that cannot contain any solutions. And that's how far you move
>> along the ray. (Rather than having a constant step width.)
> 
> Distance Fields are similar to isosurfaces, but the isosurface value is
> used to store the minimum possible distance to any surface. Then it
> makes your raymarcher algorithm very simple:
> 
> do{
>  point = rayStart + rayDirection * distance
>  stepSize = EvaluateDistanceField(point)
>  distance += stepSize
> }
> while( stepSize > someVerySmallAmount)
> 
> The functions and methods are very similar to isosurfaces:
> 
> http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm
> 
> There are also some clever tricks you can do to get soft shadows and
> ambient occlusion for free.
> 
ahem...

The described distance fields are exactly povray isosurface :
first vector (vec p) is the position, and the other optional parameters
are the formula's specific constants if any. (the threshold parameter of
povray is a bonus to adjust the surface, but you can keep it at 0 and
change the formula instead).

The difference is mainly syntax and the capability to have intermediate
computation within the definition of distance field, whereas for an
isosurface the formula must be provided at once (which might preclude
some optimisations such as factoring the same sub-computation-branch).

Very interesting page, including the nice smin() approaches (in another
page).

We could greatly enhance the documentation of povray's isosurfaces with
such examples/illustration (and providing alternative to the blob-like
smooth transits with translation of the various smin's alternatives)





-- 
Just because nobody complains does not mean all parachutes are perfect.


Post a reply to this message

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