home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / raytrace / polyray / dat / gridded / river.pi < prev    next >
Encoding:
Text File  |  1993-11-07  |  4.1 KB  |  146 lines

  1. // Polyray input file: Alexander Enzmann
  2. //
  3. // This is a view of a river winding through a forest, three trees in various
  4. // orientations are instantiated using a color mapped targa for placement. The
  5. // riverbed was created using a draw program, followed by color separation,
  6. // followed by removal of green and blue channels, then a gaussian blue was
  7. // applied to the remaining (red) channel to make the smooth banks on the river.
  8. // The trees were generated with a variant of the SPD tree program, with
  9. // textured spheres used to represent the leaves.
  10. //
  11. // This data file will require at least 4 meg of memory. Depending on which
  12. // memory manager you use, you may need more.  (HIMEM.SYS works on my machine,
  13. // 386MAX runs out of space.)
  14. //
  15. // Render at high resolution in order to see the detail in the trees.  You can
  16. // comment out the trees & use spheres if you want to see how things will be
  17. // laid out without needing huge amounts of memory.
  18. //
  19. viewpoint {
  20.    from <0, 0.9, -7>
  21.    at <0.5, 0, -3.5>
  22.    up <0,1,0>
  23.    angle 45
  24.    resolution 800, 600
  25.    aspect 4/3
  26.    }
  27.  
  28. // Set up background color & lights
  29. background white
  30. light <-20, 100,-5>
  31. include "..\colors.inc"
  32.  
  33. define position_objectx  1
  34. define ripple_normal     2
  35.  
  36. define bumpy_green
  37. texture {
  38.    special surface {
  39.       normal N + dnoise(3*W)
  40.       ambient green, 0.2
  41.       diffuse green, 0.3
  42.       specular white, 0.7
  43.       microfacet Reitz 10
  44.       }
  45.    scale <0.02, 0.02, 0.02>
  46.    }
  47.  
  48. define river_colors
  49. texture {
  50.    noise surface {
  51.       ambient 0.2
  52.       diffuse 0.8
  53.       specular 0.1
  54.       position_fn position_objectx
  55.       normal 3
  56.       frequency 1
  57.       bump_scale 1
  58.       color_map(
  59.          [-130, -127, blue,  blue]
  60.      [-127, -125, blue,  tan]
  61.      [-125, -64,  tan,   tan]
  62.      [-64,  -32,  tan,   green]
  63.      [-32,  130,  green, green])
  64.       }
  65.    rotate <0, 0, 90>
  66.    }
  67.  
  68. define cloudy_sky
  69. texture {
  70.    special surface {
  71.       ambient 0.9
  72.       diffuse 0
  73.       specular 0
  74.       color color_map(
  75.      [0.0, 0.6, <0.4, 0.4, 0.4>, <1, 1, 1>]
  76.      [0.6, 0.8, <1, 1, 1>, <0.196078, 0.6, 0.8>]
  77.      [0.8, 1.0, <0.196078, 0.6, 0.8>, <0.196078, 0.6, 0.8>])[noise(3*P, 3)]
  78.       }
  79.    }
  80.  
  81. define blue_ripple
  82. texture {
  83.    noise surface {
  84.       color <0.4, 0.4, 1.0>
  85.       normal ripple_normal
  86.       frequency 35
  87.       bump_scale 1
  88.       ambient 0.3
  89.       diffuse 0.4
  90.       specular white, 0.6
  91.       reflection white, 0.6
  92.       microfacet Reitz 10
  93.       }
  94.    translate <3, 0, -3>
  95.    }
  96.  
  97. object {
  98.      object {
  99.         smooth_height_field "rivermap.tga"
  100.         scale <12, 0.001, 12>
  101.         translate <-6, 0, -6>
  102.         river_colors
  103.         }
  104.    + object {
  105.        polygon 4, <-7, -0.1, -7>, <-7, -0.1, 7>, <7, -0.1, 7>, <7, -0.1, -7>
  106.        blue_ripple
  107.        }
  108.    rotate <0, 10, 0>
  109.    }
  110.  
  111. include "btree1.inc"
  112. include "btree2.inc"
  113. include "btree3.inc"
  114. object {
  115.    gridded "rivtrees.tga",
  116.       //object { sphere <0.5, 0.3, 0.5>, 0.3 shiny_red }
  117.       //object { sphere <0.5, 0.3, 0.5>, 0.3 shiny_green }
  118.       //object { sphere <0.5, 0.3, 0.5>, 0.3 shiny_blue }
  119.       //object { sphere <0.5, 0.3, 0.5>, 0.3 shiny_cyan }
  120.       //object { sphere <0.5, 0.3, 0.5>, 0.3 shiny_yellow }
  121.       //object { sphere <0.5, 0.3, 0.5>, 0.3 shiny_magenta }
  122.       //object { sphere <0.5, 0.3, 0.5>, 0.3 shiny_coral }
  123.       //object { sphere <0.5, 0.3, 0.5>, 0.3 matte_white }
  124.       //object { sphere <0.5, 0.3, 0.5>, 0.3 matte_grey }
  125.       tree1
  126.       tree2
  127.       tree3
  128.       tree1 { translate <-0.5,0,-0.5> rotate <0,120,0> translate <0.5,0,0.5>}
  129.       tree2 { translate <-0.5,0,-0.5> rotate <0,120,0> translate <0.5,0,0.5>}
  130.       tree3 { translate <-0.5,0,-0.5> rotate <0,120,0> translate <0.5,0,0.5>}
  131.       tree1 { translate <-0.5,0,-0.5> rotate <0,240,0> translate <0.5,0,0.5>}
  132.       tree2 { translate <-0.5,0,-0.5> rotate <0,240,0> translate <0.5,0,0.5>}
  133.       tree3 { translate <-0.5,0,-0.5> rotate <0,240,0> translate <0.5,0,0.5>}
  134.    scale <6/32, 6/32, 6/32>
  135.    translate <-6, 0, -6>
  136.    rotate <0, 10, 0>
  137.    }
  138.  
  139. object {
  140.    sphere <0, 0, 0>, 1000
  141.    scale <1, 0.01, 1>
  142.    cloudy_sky { scale <50, 50, 50> }
  143.    shading_flags 0
  144.    rotate <5, 0, 0>
  145.    }
  146.