POV-Ray : Newsgroups : povray.binaries.images : Realistic rocks Server Time
12 May 2024 02:08:55 EDT (-0400)
  Realistic rocks (Message 1 to 1 of 1)  
From: Thomas de Groot
Subject: Realistic rocks
Date: 6 Jan 2010 08:27:24
Message: <4b448fbc@news.povray.org>
While exploring ways to simulate realistic rocks, I developped the following 
code for use with Bill Pragnell's MeshRelief. It looks very much like some 
types of layered and weathered sedimentary rocks. For those of you 
interested, here follows the code to use with MeshRelief and a suitable rock 
object of your choice:

//Pigments:
#declare p4 =
pigment {
  quilted
  control0 0.99
  control1 0.99
  frequency 1
  color_map {
    [0.00 rgb 0.2]
    [0.40 rgb 0.5]
    [0.45 rgb 1.0]
    [1.00 rgb 1.0]
  }
  warp {turbulence <0.9, 0.2, 0.5>}
  scale <0.5, 0.05, 0.4>
  warp {turbulence <0.1, 0.1, 0.3>}
  rotate 5*z
}

#declare p5 =
pigment {
  average
  pigment_map {
    [1 p4]
    [0.5 wrinkles scale 0.5 warp {turbulence 0.2}]
  }
}

#declare Pig =
pigment {
  quilted
  control0 0.99
  control1 0.99
  frequency 1
  color_map {
    [0.00 rgb <0.2, 0.10, 0.01>]
    [0.40 rgb <0.4, 0.20, 0.10>]
    [0.45 rgb <0.1, 0.03, 0.01>]
    [1.00 rgb <0.1, 0.05, 0.00>]
  }
  warp {turbulence <0.9, 0.2, 0.5>}
  scale <0.5, 0.05, 0.4>
  warp {turbulence <0.1, 0.1, 0.3>}
  rotate 5*z
}

//Usage:
#declare dep = 0.1;

object {
  MeshShape(MyObj, inobj, Center, 500, p5, dep, no, no, "")
  texture {pigment {Pig} normal {granite 0.8 scale 0.001}}
}


-- 
All the best,

Thomas


Post a reply to this message


Attachments:
Download 'BP_meshdemo.jpg' (88 KB)

Preview of image 'BP_meshdemo.jpg'
BP_meshdemo.jpg


 

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