POV-Ray : Newsgroups : povray.newusers : simulating cracks in surface using normals : Re: simulating cracks in surface using normals Server Time
29 Jul 2024 04:21:20 EDT (-0400)
  Re: simulating cracks in surface using normals  
From: Chris B
Date: 27 Oct 2006 06:44:37
Message: <4541e315@news.povray.org>
"Toon" <nomail@nomail> wrote in message 
news:web.4540ddd084a00c02109a9bf40@news.povray.org...
>
> Thanks for all the tips, after playing around with crackle and slope_maps, 
> I
> can get someting that looks a little like what I want, but not entirely. I
> can't seem to get any really deep cracks.
> ... snip ...
>

Hi Toon,

As Trevor mentioned, the normals you apply are just faking it.

One way of faking it a little bit more is to overlay your own darkening of 
the cracks using a colour pattern.
The 'NewCracks' texture below uses the crackle as a pigment instead of a 
normal.
'NewCracks2' uses a slightly smaller crackle as a pigment and combines it 
with the original crackle normal to emphasise the highlights on the rims. It 
also takes the 'darkened' Orange color right down to 0 to give a really deep 
dark centre.

Hope this helps.

Regards,
Chris B.


camera {look_at <0.0,0,0>
        location <-5 , 0.0 , -20>
       }

global_settings {radiosity {}}

#include "colors.inc"

light_source{<1000,1000,-1000>  color rgb 0.5}

sky_sphere {pigment{color rgb 2}}

plane { y, -6 texture {pigment {color rgb <1,1,1>} finish {ambient 0.1
diffuse 0.2}}}

plane {z, 1000 pigment {color rgb 0.5}}

#declare MouldedLook=normal{bozo -8 scale 3 }
#declare Cracks=normal{crackle
                       scale 10
                       turbulence <0.7,0.5,0>
                       slope_map {[0, <-1,0>]
                                  [0.01 <-1,0>]
                                  [0.01 <0,0>]
                                  [1 <0,0>]
                                 }
}

#declare NoNormal=normal{bumps 0.00001}
#declare MouldedCracks=normal{average
normal_map{[1,MouldedLook][1,Cracks][-1,NoNormal]}}

#declare NewCracks = texture {
  pigment{
    crackle
    scale 10
    turbulence <0.7,0.5,0>
    color_map {
      [0    rgbt 0.8*Orange]
      [0.0003 rgbt 0.5*Orange]
      [0.01 rgbt 0.8*Orange]
      [0.01 rgbt Orange]
      [1    rgbt Orange]
    }
  }
  normal{bozo 8 scale 3}
}

#declare NewCracks2 = texture {
  pigment{
    crackle
    scale 10
    turbulence <0.7,0.5,0>
    color_map {
      [0      rgbt 0.8*Orange]
      [0.0003 rgbt 0*Orange]
      [0.009  rgbt 0.8*Orange]
      [0.009  rgbt Orange]
      [1      rgbt Orange]
    }
  }
  normal{average normal_map{[1,MouldedLook][1,Cracks][-1,NoNormal]}}
}

sphere { <0,0,0>,6 texture{pigment{color Orange} normal{Cracks} finish
{ambient 0 diffuse 0.6}} translate <-10,0,0> }
sphere { <0,0,0>, 6 texture{NewCracks}
finish {ambient 0 diffuse 0.6}translate <0,0,0> }
sphere { <0,0,0>,6 texture{NewCracks2}
finish {ambient 0 diffuse 0.6} translate <10,0,0> }


Post a reply to this message

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