POV-Ray : Newsgroups : povray.general : Simulating wrinkled golden foil : Re: Simulating wrinkled golden foil Server Time
4 Nov 2024 21:26:53 EST (-0500)
  Re: Simulating wrinkled golden foil  
From: Hughes, B 
Date: 12 Sep 2003 22:09:41
Message: <3f627c65@news.povray.org>
"Bjorn Jonsson" <bjj### [at] zzzmmediais> wrote in message
news:MPG.19cc76e1fe4edb0198968c@news.povray.org...
> Can anyone give me hints on how to realistically simulate wrinkled,
> golden foil ?

I was trying one out to post here and I see Chip replied with a similar
suggestion. If you understand the functions and isosurface object you should
be able to adjust the following to suit your needs. It might prove slow to
render.

camera {translate -3*z rotate <22.5,0,0>}

light_source {-33*z,1 rotate <45,45,0>}

#declare FoilScale=0.5;

#declare WrinkledFoilMaterial=
material {
 texture {
  pigment {
   rgb <1,0.7,0.3>
  }
  normal {
   wrinkles 0.04 scale 0.04
  }
  finish {
   ambient 0 diffuse 0.1
   specular 0.9 roughness 0.009
   metallic 0.9 brilliance 1
   conserve_energy
   reflection {
    <1,0.6,0.2>*0.6,<1,0.6,0.2>*0.9
    metallic
    fresnel on
    exponent 0.9
   }
  }
 }
 interior {
  ior 15
 }
}

#declare BumpFoilPattern=
function {
 pigment {
  crackle metric 3 offset 2
  scale <0.05,0.05,0.05> turbulence 0.1
  color_map {
   [0 rgb 0.9]
   [1 rgb 0.99]
  }
 }
}

#declare WrinkleFoilPattern=
function {
 pigment {
  wrinkles
  scale <0.25,0.125,0.125>*2 rotate 15 turbulence 0.1
  color_map {
   [0 rgb 0.9]
   [1 rgb 0.99]
  }
 }
}

#declare WrinkledFoil=
isosurface {
 function {
  (x*x+y*y+z*z) // shape
  -
  (BumpFoilPattern(x*FoilScale,y*FoilScale,z*FoilScale).gray
  *
  WrinkleFoilPattern(x*FoilScale,y*FoilScale,z*FoilScale).gray)
 }
 contained_by {
  sphere {0,1}
 }
 threshold 0
 accuracy 0.005
 max_gradient 3
 material {
  WrinkledFoilMaterial
 }
}

object {
 WrinkledFoil
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0 rgb 1]
      [1 rgb 0]
    }
    sine_wave
  }
}


Post a reply to this message

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