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 1115, Thu May 5 04:42:18 2011 UTC revision 1124, Thu May 5 10:59:35 2011 UTC
# Line 44  Line 44 
44      real rayU = lerp(-camUmax, camUmax, -0.5, real(ui), real(imgResU)-0.5);      real rayU = lerp(-camUmax, camUmax, -0.5, real(ui), real(imgResU)-0.5);
45      real rayV = lerp(-camVmax, camVmax, -0.5, real(vi), real(imgResV)-0.5);      real rayV = lerp(-camVmax, camVmax, -0.5, real(vi), real(imgResV)-0.5);
46      vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;      vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;
47        vec3 vv = normalize(-rayVec);
48    
49      real rayN = camVspNear;      real rayN = camVspNear;
50      real rayTransp = 1.0;      real rayTransp = 1.0;
# Line 65  Line 66 
66                real k1 = (trace(G) + disc)/2.0;                real k1 = (trace(G) + disc)/2.0;
67                real k2 = (trace(G) - disc)/2.0;                real k2 = (trace(G) - disc)/2.0;
68                // finished curvature computation; begin finding sample RGBA                // finished curvature computation; begin finding sample RGBA
69                k1 = max(-1.0, min(1.0, 5.0*k1));                k1 = max(-1.0, min(1.0, 6.0*k1));
70                k2 = max(-1.0, min(1.0, 5.0*k2));                k2 = max(-1.0, min(1.0, 6.0*k2));
71                vec3 matRGB = RGB([k1,k2]);                vec3 matRGB = RGB([k1,k2]);
72                real alpha = min(1.0, lerp(0.0, 1.0,                real alpha = min(1.0, lerp(0.0, 1.0,
73                                           valOpacMin, val, valOpacMax));                                           valOpacMin, val, valOpacMax));
74                real ld = max(0.0, norm • lightDir);                real ld = max(0.0, norm • lightDir);
75                real hd = max(0.0, norm • normalize(lightDir +                real hd = max(0.0, norm • normalize(lightDir + vv));
                                                   normalize(camEye - pos)));  
76                // Phong shading                // Phong shading
77                vec3 pntRGB = (phongKa*matRGB                vec3 pntRGB = (phongKa*matRGB
78                               + phongKd*ld*modulate(matRGB, lightRGB)                               + phongKd*ld*modulate(matRGB, lightRGB)

Legend:
Removed from v.1115  
changed lines
  Added in v.1124

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