home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1995 January / pcw-0195.iso / polyray / dat / texture / wire.pi < prev    next >
Text File  |  1994-12-31  |  1KB  |  50 lines

  1. //
  2. // Texture that simulates the "screen" shader in the Renderman Companion
  3. //
  4. // Polyray input file: Alexander Enzmann
  5.  
  6. // Set up the camera
  7. viewpoint {
  8.    from <0,5,-7>
  9.    at <0,0,0>
  10.    up <0,1,0>
  11.    angle 45
  12.    resolution 256, 256
  13.    }
  14.  
  15. background <0, 0, 0>
  16. light <-10, 20, -20>
  17.  
  18. include "../colors.inc"
  19.  
  20. define roughness 0.1
  21. define density 0.15
  22. define freq 4
  23.  
  24. //
  25. // "wire_exper" returns 1 if we are on the visible part of the surface,
  26. // and returns 0 if we are on the see-through part of the surface.
  27. //
  28. define wire_exper (|fmod(freq * P[0], 1)| < density ? 1
  29.                      : (|fmod(freq * P[1], 1)| < density ? 1 : 0))
  30. define wire_red
  31. texture {
  32.    special surface {
  33.       ambient wire_exper * red, 0.1
  34.       diffuse wire_exper * red, 0.4
  35.       specular wire_exper * white, 0.5
  36.       microfacet Reitz 10
  37.       transmission white, 1 - wire_exper, 1.0
  38.       }
  39.    }
  40.  
  41. object {
  42.    sphere <0, 0, 0>, 2
  43.    wire_red
  44.    }
  45.  
  46. object {
  47.    disc <0, -2, 0>, <0, 1, 0>, 10
  48.    texture { checker matte_white, matte_black }
  49.    }
  50.