26.01.2015 Views

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

distantlight(<br />

float intensity = 1;<br />

color lightcolor = 1;<br />

point from = point ”shader” (0,0,0);<br />

point to = point ”shader” (0,0,1);<br />

{<br />

solar(to-from, 0.0)<br />

Cl = intensity * lightcolor;<br />

}<br />

A.3.3<br />

Point light source<br />

light<br />

pointlight(<br />

float intensity = 1;<br />

color lightcolor = 1;<br />

point from = point ”shader” (0,0,0); )<br />

{<br />

illuminate(from)<br />

Cl = intensity * lightcolor / L.L;<br />

}<br />

A.3.4<br />

Spotlight source<br />

light<br />

spotlight(<br />

float intensity = 1;<br />

color lightcolor = 1;<br />

point from = point ”shader” (0,0,0);<br />

point to = point ”shader” (0,0,1);<br />

float coneangle = radians(30);<br />

float conedeltaangle = radians(5);<br />

float beamdistribution = 2;)<br />

{<br />

float atten, cosangle;<br />

uniform vector A = (to - from)/length(to-from);<br />

illuminate(from, A, coneangle) {<br />

cosangle = L . A / length(L);<br />

atten = pow(cosangle, beamdistribution) / L.L;<br />

atten *= smoothstep(cos(coneangle),<br />

cos(coneangle - conedeltaangle), cosangle);<br />

Cl = atten * intensity * lightcolor;<br />

}<br />

}<br />

158

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!