POV-Ray : Newsgroups : povray.advanced-users : Applying noise to geometry Server Time
29 Mar 2024 02:08:50 EDT (-0400)
  Applying noise to geometry (Message 17 to 17 of 17)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Chris R
Subject: Re: Applying noise to geometry
Date: 16 May 2023 16:40:00
Message: <web.6463e9ae2d727589a39f4a525cc1b6e@news.povray.org>
yesbird <sya### [at] gmailcom> wrote:
> Hi,
> while working on Yes-project, I am trying to find the way of making
> the objects less 'geometrical', giving them more natural and 'noisy'
> shapes (like in this attachment, for example). The only way I found in
> manual is to play with normals, but I'd like to have an influence on
> geometry, to apply more relief.
>
> It's possible to pass a noisy hi-res mesh from ZBrush, as I'm doing now,
> but this is not 'pure' POV-way and import takes some 'non-zero' time.
>
> Maybe anyone can advise something about such arbitrary geometry
> modifications ?
> Thanks in advance.
> --
> YB
My preferred method for doing this, albeit introducing some longer render times,
is to use isosurface objects.  I usually start with a function that defines the
non-perturbed shape of the object, e.g.:

#local _shape_fn = function(x,y,z) {
   sqrt(x*x+y*y+z*z) - 1
}

for a 1-unit radius sphere.

I then use one of several techniques to do the perturbations.  For example,

#local _shape_fn = function(x,y,z) {
   sqrt(x*x+y*y+z*z) - (1+0.1*f_snoise3d(x,y,z))
}

or
#local _pattern_fn = function {
   pigment {
      bozo
      color_map {
         [0.0 rgb 0]
         [1.0 rgb 1]
      }
   }
}
#local _shape_fn = function(x,y,z) {
   sqrt(x*x+y*y+z*z) - (1 + 0.1*_pattern_fn(x,y,z).gray)
}

or, if your shape function is well-behaved, (i.e. returns a value representing
the distance from a point to the surface of your object), you could do it this
way instead:

#local _shape2_fn = function(x,y,z) {
   _shape_fn(x,y,z) - 0.1*_pattern_fn(x,y,z).gray
}

The attached image is a pretty complex example, where the basic shape of the
wood-part of the blocks is basically f_rounded_box, but patterns are applied for
the wood grain, dents in the wood, cracks in the wood, etc.

-- Chris R.


Post a reply to this message


Attachments:
Download 'blocks-2023-05-04-1.png' (1276 KB)

Preview of image 'blocks-2023-05-04-1.png'
blocks-2023-05-04-1.png


 

<<< Previous 10 Messages Goto Initial 10 Messages

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