POV-Ray : Newsgroups : povray.text.scene-files : mountians with snow preferential to shadows Server Time
22 Dec 2024 14:41:16 EST (-0500)
  mountians with snow preferential to shadows (Message 1 to 1 of 1)  
From: Hughes, B 
Subject: mountians with snow preferential to shadows
Date: 2 Nov 2003 00:57:33
Message: <3fa49ccd@news.povray.org>
/* Justin Smith's modified pov script to try and make it seem snow is in
shadowed places. I've only rewritten this as an example which hopefully does
exactly what was intended. However, no guarantee! */

// Persistence of Vision Ray Tracer Scene Description File
// File: mountians with snow preferential to shadows.pov
// Vers: 3.5
// Desc: mountains and snow, with more snow in shadows
// Date: 2003.833
// Auth: Justin and Bob

global_settings {
 assumed_gamma 1.0
 ambient_light 0 // radiosity uses diffuseness, 0 for ambient then
 radiosity {gray_threshold 0.7}
}

// perspective camera
camera {
  location  <0.0, 2.0, -5.0>*1000
  look_at   <0.0, 0.0,  0.0>
  right     x*image_width/image_height
  rotate -45*y // 90 degree azimuth difference from light source
}

// create a regular point light source
light_source {
  -1000*z,
  color rgb <1,1,1>
  rotate <45, 45, 0>
}

// suburban clear sky colors
sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.7,0.65,0.75>]
      [0.025 rgb <0.6,0.6,0.8>]
      [0.05 rgb <0.4,0.6,1.1>]
      [0.15 rgb <0.25,0.55,1.2>]
      [0.4 rgb <0.2,0.45,1.1>]
      [1.0 rgb <0.15,0.35,0.8>]
    }
  }
}

#declare fnpigment1 =function {
pigment
{
agate
color_map {
 [0 rgb 0]
 [1 rgb 1]
} scale 5000
}
}

#declare fnpigment2 =function {
pigment
{
granite
color_map {
 [0 rgb 0]
 [1 rgb 1]
} scale 5000
}
}

#declare fnpigment3 =function {
pigment
{
bumps
color_map {
 [0 rgb 0]
 [1 rgb 1]
} scale 5000
}
}

#declare pigment1 =
pigment
{
  slope
  {
    y, 0, 1 // range of color map
  }
  color_map
  {
    [0 color rgbt <0,0,0,1>]
    [.3 color rgbf <1,1,1,.9>]
    [1 color rgbf <1,1,1,0>]
  }
}

#declare pigment2 =
pigment
{
  slope
  {
    y, 0, 1 // range of color map
  }
  color_map
  {
    [0 color rgbt <0,0,0,1>]
    [.6 color rgbf <1,1,1,.6>]
    [1 color rgbf <1,1,1,0>]
  }
}

#declare pigment3 =
pigment
{
  slope
  {
    <-1,1,-1>, // align with light, colormap index 1 toward it
    0, 1 // range of color map
  }
  color_map
  {
    [.3 color rgbf <1,1,1,0>] // mostly shadowed ground
    [.5 color rgbf <1,1,1,.3>]
    [.7 color rgbf <1,1,1,.9>]
    [.9 color rgbf <1,1,1,1>]
  }
}

#declare Mountains =
  isosurface
  {
    function
    {
      (y
      -
      fnpigment2(x,y,z).gray*100)
      -
      (fnpigment1(x,y,z).gray
      +
      fnpigment1(x,y,z).gray*10
      +
      fnpigment2(x,y,z).gray*10
      +
      fnpigment3(x,y,z).gray*.05)
    }
    contained_by
    {
      box
      {
        <-5000,0,-5000>,<5000,125,5000>
      }
    }
    max_gradient 1
    texture
    {
      pigment {rgb <1,0,0>}
      finish {ambient .1 diffuse .5}
    }

    texture
    {
      pigment
      {
        gradient y
        //turbulence <0,.1,0>
        pigment_map
        {
          [.5 color rgbf <1,1,1,1>]
          [.6 pigment1]
          [.8 pigment2]
          [1 color rgbf <1,1,1,0>]
        }
        scale 125
      }
      finish
      {
        ambient .4
        diffuse .8
      }
    }

    texture
    {
      pigment
      {
        gradient y
        //turbulence <0,.1,0>
        pigment_map
        {
          [.2 color rgbf <1,1,1,1>]
          [.4 pigment3]
          [.5 pigment3]
          [.6 color rgbf <1,1,1,1>]
        }
        scale <333,125,333>
      }
      finish
      {
        ambient .4
        diffuse .8
      }
    }
    scale <1,4,1>
  }

object {Mountains}


Post a reply to this message

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