POV-Ray : Newsgroups : povray.beta-test.binaries : Function / pattern issues. Povr surface normal{} like dents. : Function / pattern issues. Povr surface normal{} like dents. Server Time
26 Feb 2024 15:28:39 EST (-0500)
  Function / pattern issues. Povr surface normal{} like dents.  
From: William F Pokorny
Date: 21 Aug 2020 07:34:15
Message: <5f3fb137$1@news.povray.org>
<---------------------- References. Fourteen previous posts

Function / pattern issues. New inbuilt f_elliptical_sphrswp().
http://news.povray.org/povray.beta-test.binaries/thread/%3C5ee529b9%241%40news.povray.org%3E/

and

Function / pattern issues. Povr supertoroid parametric.
http://news.povray.org/povray.beta-test.binaries/thread/%3C5ee61540%241%40news.povray.org%3E/

Some time ago Bald Eagle asked about implementing normal like dents for 
isosurfaces. After implementing a supporting function f_normal(), I've 
coded up in SDL a function (inside functions.inc) called F_ndents(). It 
uses too the previously implemented inbuilt f_dents() and 
f_turbulence(). The latter with the fixed, non-drifting distribution - 
internal Turbulence() function.

To set the table, the dents pattern is one of a few which is implemented 
differently for normal{} use than it is for *map use. The former 
determines and applies a perturbation to the existing surface normal; 
the latter returns a single value which can be used with a *map, among 
other things.

F_ndents() determines the surface normal of the base isosurface shape 
function with f_normal() and perturbs that normal by f_turbulence where 
determined by the f_dents() pattern. The perturbed normal is then used 
to warp/move the effective x,y and z coordinates.

This function/shape deformation approach has advantages. The 
perturbation is only inward or outward relative to the base shape 
surface normal. Further, the deformation by perturbed normal coordinates 
doesn't ever 'fracture' the function/shape(1).

Functions where only values are used - say f_noise3d() added to the 
shape's returned function values - to roughen a surface very often do. 
Especially true where values are added to the base shape function - bits 
and pieces often end up floating above the surface.

(1) - Yep. Lying a little. If the isosurface gradient setting (or image 
resolution) isn't great enough, you can still 'see' fracturing. Further, 
the displacements, if violent enough, can turn inside out surface wise.


Attached we have 4 images using the new F_ndents(). The upper left the 
dents + turbulence is applied outward relative to the surface normal. In 
the other three images showing inward 'dents'. All at various scaling of 
f_dents() and f_turbulence(). There is too a normal like pattern value / 
bump_size value being changed to set 'dent in/out direction' and depth. 
The existing normal {dents} implementation cannot scale 'dents' and 
'turbulence' differently and so is most like the lower right corner 
result with an ability to scale larger or smaller in total.

IIRC. Upper left image took a couple minute on my i3. The rest 30 
seconds or less. One light and radiosity.

I still have in mind F_crumple() and/or F_collision() functions too - 
someday.

Aside: Playing with just a scaled f_normal() as an alternative to shape 
'value shells' might be interesting too as a well to get more normalize 
thicknesses.  I've not had time to try this thought as yet.

---
Generally. Other new functions are f_length() and f_normalized(). Also 
back tracked and added *map value support to more recently added 
functions where supporting *maps could be of use. I'd originally planned 
such *map value support for f_eblob() alone.

Bill P.


Post a reply to this message


Attachments:
Download 'f_ndentsstory.jpg' (103 KB)

Preview of image 'f_ndentsstory.jpg'
f_ndentsstory.jpg


 

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