Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/test/vr-curv-quad.diderot
ViewVC logotype

Diff of /trunk/test/vr-curv-quad.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1163, Mon May 9 18:56:39 2011 UTC revision 1330, Mon Jun 13 00:13:54 2011 UTC
# Line 70  Line 70 
70                real k1 = (trace(G) + disc)/2.0;                real k1 = (trace(G) + disc)/2.0;
71                real k2 = (trace(G) - disc)/2.0;                real k2 = (trace(G) - disc)/2.0;
72                // find material RGBA                // find material RGBA
73                vec3 matRGB = RGB([max(-1.0, min(1.0, 6.0*k1)),                vec3 matRGB = RGB([clamp(-1.0, 1.0, 6.0*k1),
74                                   max(-1.0, min(1.0, 6.0*k2))]);                                   clamp(-1.0, 1.0, 6.0*k2)]);
75                real alpha = min(1.0, lerp(0.0, 1.0,                real alpha = min(1.0, lerp(0.0, 1.0,
76                                           valOpacMin, val, valOpacMax));                                           valOpacMin, val, valOpacMax));
77                real ld = max(0.0, norm • lightDir);                real ld = max(0.0, norm • lightDir);
# Line 81  Line 81 
81                               + phongKd*ld*modulate(matRGB, lightRGB)                               + phongKd*ld*modulate(matRGB, lightRGB)
82                               + phongKs*hd^phongSp*lightRGB);                               + phongKs*hd^phongSp*lightRGB);
83                // composite with existing ray color and transparency                // composite with existing ray color and transparency
84                rayRGB = rayRGB + rayTransp*alpha*pntRGB;                rayRGB += rayTransp*alpha*pntRGB;
85                rayTransp = rayTransp*(1.0 - alpha);                rayTransp *= 1.0 - alpha;
86            }            }
87         }         }
88         if (rayTransp < 0.01) {  // early ray termination         if (rayTransp < 0.01) {  // early ray termination

Legend:
Removed from v.1163  
changed lines
  Added in v.1330

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0