home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 August / chip_08_2000.iso / aktualnosci / shareware / Rhinoceros / rh11eval_20000320.exe / %MAINDIR% / RIB / rh_pointlight.sl < prev    next >
Encoding:
Text File  |  2000-06-08  |  932 b   |  27 lines

  1. /* rh_pointlight -- A custom pointlight shader for using pointlights
  2.  * in Rhino. This one uses the light color for determining the intensity,
  3.  * since Rhino currently does not have a light intensity setting.
  4.  * The intensity varies between 1 and 4.9e8.
  5.  * It is based on pointlight.sl by Pixar.
  6.  *
  7.  * pointlight.sl - Standard point light source for RenderMan Interface.
  8.  * (c) Copyright 1988, Pixar.
  9.  *
  10.  * The RenderMan (R) Interface Procedures and RIB Protocol are:
  11.  *     Copyright 1988, 1989, Pixar.  All rights reserved.
  12.  * RenderMan (R) is a registered trademark of Pixar.
  13.  */
  14.  
  15. light
  16. rh_pointlight (color lightcolor = 1;
  17.         point from = point "shader" (0,0,0);)
  18. {
  19.   float intensity, maxintensity;
  20.   
  21.   maxintensity = max ( comp( lightcolor, 0), comp( lightcolor, 1), comp(lightcolor, 2));
  22.   intensity = exp( maxintensity * 20);  
  23.  
  24.   illuminate (from)
  25.       Cl = intensity * lightcolor / (L . L);
  26. }
  27.