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

  1. /** k3d_waterlight
  2.  
  3. Copyright (c) 1995-2004, Timothy M. Shead
  4.  
  5. A cheap trick to simulate underwater caustics - best used for deep-sea effects
  6.  
  7. */
  8.  
  9. light k3d_waterlight(
  10.     float minimum_intensity = 0.3;
  11.     float maximum_intensity = 1.0;
  12.     float frequency = 1;
  13.     float phase = 0;
  14.     color lightcolor = 1;
  15.     string shadowname="";
  16.     float  samples=16;
  17.     float  blur=.01;
  18.     float  bias=.01;
  19.     )
  20. {
  21.     solar(vector "shader" (0, 0, -1), 0)
  22.     {
  23.         Cl = mix(minimum_intensity, maximum_intensity, float noise(frequency * Ps)) * lightcolor;
  24.         
  25.         if(shadowname != "")
  26.         {
  27.             Cl *= 1 - shadow(shadowname, Ps, "samples", samples, "blur", blur, "bias", bias);
  28.         }
  29.     }
  30. }
  31.  
  32.