POV-Ray : Newsgroups : povray.advanced-users : Applying noise to geometry : Re: Applying noise to geometry Server Time
21 Jun 2024 01:28:47 EDT (-0400)
  Re: Applying noise to geometry  
From: ingo
Date: 27 Feb 2023 14:15:00
Message: <web.63fd01122d72758917bac71e8ffb8ce3@news.povray.org>
yesbird <sya### [at] gmailcom> wrote:

> 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.
>

If you create your mesh with macros you can use (noise)functions to displace
vertices of the mesh. Here an example using crackle pattern for displacement.

---%<------%<------%<---

#version 3.8;

#include "meshmaker.inc"

global_settings {assumed_gamma 1.0}
camera {
   location  <0,1,-10>
   look_at   <0,0,0>
   angle 20
}
light_source { <500,500,-500> rgb <1,0.9,0.8> }
light_source { <-100,100,-500> rgb <0.3,0.3,0.5> }

#declare Crack= function {
  pigment {
    crackle
    colour_map{
      [0, rgb .01]
      [1, rgb .05]
    }
    scale 0.05
  }
}
#declare R= function(u,v) {
  Crack(u,v,0).gray * 5
}

#declare F1= function(u,v){(.5+R(u,v))*cos(u)}
#declare F2= function(u,v){(.5+R(u,v))*sin(u)}
#declare F3= function(u,v){v - R(u,v)}  // pull the spikes up

object{
   Parametric(
      F1, F2, F3,
      <0, -1>,
      <2*pi, 1>,
      500, 500, ""
   )
   uv_mapping
   pigment{rgb 1}
   finish{specular 0.5}
   rotate <60,0,0>
}

---%<------%<------%<---

ingo


Post a reply to this message

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