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.

{<br />

}<br />

float IdotN = I.N;<br />

float k = 1 - eta*eta*(1 - IdotN*IdotN);<br />

return k < 0 (0,0,0) : eta*I - (eta*IdotN + sqrt(k))*N;<br />

Return the transmitted vector given an incident direction I, the normal vector N and<br />

the relative index of refraction eta. eta is the ratio of the index of refraction in the volume<br />

containing the incident vector to that of the volume being entered. This vector<br />

is computed using Snell’s law. If the returned vector has zero length, then there is no<br />

transmitted light because of total internal reflection.<br />

fresnel( vector I, N; float eta; output float Kr, Kt; [output vector R, T] )<br />

Return the reflection coefficient Kr and refraction (or transmission) coefficient Kt<br />

given an incident direction I, the surface normal N, and the relative index of refraction<br />

eta. eta is the ratio of the index of refraction in the volume containing the incident<br />

vector to that of the volume being entered. <strong>The</strong>se coefficients are computed using<br />

the Fresnel formula. Optionally, this procedure also returns the reflected (R) and<br />

transmitted (T ) vectors. <strong>The</strong> transmitted vector is computed using Snell’s law.<br />

point transform( string tospace; point p )<br />

point transform( string fromspace, tospace; point p )<br />

point transform( matrix m; point p )<br />

point transform( string fromspace; matrix m; point p )<br />

vector vtransform( string tospace; vector v )<br />

vector vtransform( string fromspace, tospace; vector v )<br />

vector vtransform( matrix m; vector v )<br />

vector vtransform( string fromspace; matrix m; vector v )<br />

normal ntransform( string tospace; normal n )<br />

normal ntransform( string fromspace, tospace; normal n )<br />

normal ntransform( matrix m; normal n )<br />

normal ntransform( string fromspace; matrix m; normal n )<br />

<strong>The</strong> transform function transforms the point p from the coordinate system fromspace<br />

to the coordinate system tospace. If fromspace is absent, it is assumed to be the ”current”<br />

coordinate system. A transformation matrix may be given instead of a tospace<br />

name. <strong>The</strong> vtransform and ntransform functions perform the equivalent coordinate<br />

system transformations on vectors and normals, respectively.<br />

float depth( point P )<br />

Return the depth of the point P in camera coordinates. <strong>The</strong> depth is normalized to<br />

lie between 0 (at the near clipping plane) and 1 (at the far clipping plane).<br />

point<br />

calculatenormal( point P )<br />

{<br />

return Du(P) ˆ Dv(P);<br />

}<br />

139

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

Saved successfully!

Ooh no, something went wrong!