POV-Ray : Newsgroups : povray.binaries.images : A povr fork test image for new dens_object pattern. : Re: A povr fork test image for new dens_object pattern. Server Time
20 May 2024 05:04:03 EDT (-0400)
  Re: A povr fork test image for new dens_object pattern.  
From: William F Pokorny
Date: 3 Sep 2023 21:49:54
Message: <64f537c2$1@news.povray.org>
On 9/3/23 15:54, Samuel B. wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:
>> Attached an image from one of the dens_object pattern tests. Suppose
>> X-ray vision - or something.
>>
>> Bill P.
> 
> That's a very nice and smooth result. I haven't been following, but how does it
> work? And have you tried using as a surface normal, to fake rounded edges?
> 
> Sam
> 
Hi Sam,
Thanks. The core bit of POV-Ray (povr) code for the image is:

...
#declare ColorMap = color_map {
     [  -1 Orange ]
     [   0 ClearBlack100 ]
     [ 0.6 Yellow ]
     [   1 Yellow ]
}
#declare TextR = text {
     ttf "timrom.ttf" "R"
     0.1, 0
     translate <0,0,-0.05>
}
#declare PigListObj = pigment {
     dens_object {
         TextR
         exponent 1.2
         radius 0.044
         recursion_limit 12
         samples 44
     }
     function_interval
     color_map { ColorMap }
}
...

The dens_object pattern does a series of spherical inside tests starting 
at the radius and shrinking on each 'recursion' (actually a loop as 
implemented, but the keyword matches another pattern called 
hard_object{} where recursion is used.) The center of the spherical 
tests is at each ray-surface intersection. Sum up all the tests inside, 
divide by the number of tests and return a value in the -1 to 1 range; 
flat parts come out around 0.0. The aim of this pattern is as a 
'proximity' pattern stand in.

I had the thought to do another render where I use an inside cyan 
pigment to make it clearer which 'edges' are inside, but suppose 
something for another day.

As for using the pattern to perturb raw normals to make things look more 
rounded(a). I'd not thought about it, but I will. I've played quite a 
bit with perturbed normal methods in the povr fork. My guess is 
something based on the surface density measure could work OK for the 
'far side' edges, but might be problematic where the edge faces the 
incoming rays. There would likely be a visible discontinuity in that 
case. That said, I'll think about it. It's an interesting idea(b).

(a) - There is in the povr fork 'soft_object' which can be used to 
create an actual rounded isosurface, but with results that are often a 
little lumpy - often looking like one of your recent ray marching images.

(b) - In part because the density measured can be other than the shape / 
  surface where the normals are being perturbed. In other words, it 
might be possible to use unseen shapes as normal perturbation magnets - 
thinking aloud.

Bill P.


Post a reply to this message

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