home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / share / k3d / shaders / surface / k3d_fakesky.sl < prev    next >
Encoding:
Text File  |  2008-01-23  |  354 b   |  14 lines

  1. /*
  2.  * fakesky.sl
  3.  *
  4.  * Shader a la const that slaps a fixed blue color up on the top half of a
  5.  * sphere, with color varying a bit by altitude, in an attempt to mimic the
  6.  * clear sky.
  7.  */
  8.     
  9. surface k3d_fakesky(vector up = (0,0,1); color skycolor = (.5, .6, 1.)) {
  10.     Oi = Os;
  11.     Ci = Os * (.5 + .5 * max(0., (up . normalize(N)))) * 1.8 * skycolor;
  12. }
  13.  
  14.