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

SCM Repository

[diderot] Diff of /branches/lamont/test/vr-kcomp2.diderot
ViewVC logotype

Diff of /branches/lamont/test/vr-kcomp2.diderot

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

trunk/test/vr-kcomp2.diderot revision 1115, Thu May 5 04:42:18 2011 UTC branches/vis12/test/vr-kcomp2.diderot revision 1685, Sun Jan 22 15:23:36 2012 UTC
# Line 39  Line 39 
39      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);
40      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);
41      vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;      vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;
42      vec3 rayDir = normalize(rayVec);      vec3 vv = normalize(-rayVec);
43    
44      real rayN = camVspNear;      real rayN = camVspNear;
45      // ########## BEGIN per-ray initialization      // ########## BEGIN per-ray initialization
# Line 59  Line 59 
59            // uncaught exception Fail [Fail: bogus field binding F027D = RHS(_t0277)]            // uncaught exception Fail [Fail: bogus field binding F027D = RHS(_t0277)]
60            //  raised at high-il/high-opt.sml:74.18-76.11            //  raised at high-il/high-opt.sml:74.18-76.11
61            field#1(3)[] F = Fc0 if (myui + myvi < imgResU) else Fc1;            field#1(3)[] F = Fc0 if (myui + myvi < imgResU) else Fc1;
62            real val = F@rayPos;            real val = F(rayPos);
63            vec3 norm = normalize(-∇F@rayPos);            vec3 norm = normalize(-∇F(rayPos));
64            if (val > valOpacMin) {  // we have some opacity            if (val > valOpacMin) {  // we have some opacity
65                real opac = min(1.0, lerp(0.0, 1.0, valOpacMin, val, valOpacMax));                real opac = min(1.0, lerp(0.0, 1.0, valOpacMin, val, valOpacMax));
66                real ld = lightDir • norm;                real ld = lightDir • norm;
67                real hd = norm • normalize(lightDir + normalize(camEye - rayPos));                real hd = norm • normalize(lightDir + vv);
68                real mat = (  phongKa                real mat = (  phongKa
69                            + phongKd*(ld if ld > 0.0 else 0.0)                            + phongKd*(ld if ld > 0.0 else 0.0)
70                            + phongKs*(hd^phongSp if hd > 0.0 else 0.0));                            + phongKs*(hd^phongSp if hd > 0.0 else 0.0));
# Line 75  Line 75 
75         }         }
76         if (transp < 0.01) {  // early ray termination         if (transp < 0.01) {  // early ray termination
77            transp = 0.0;            transp = 0.0;
           // HEY (BUG) stabilize function not working  
           // setting rgba should be done there  
           rgba = [gray, gray, gray, 1.0-transp];  
78            stabilize;            stabilize;
79         }         }
80         if (rayN > camVspFar) {         if (rayN > camVspFar) {
           // HEY (BUG) (same as above)  
           rgba = [gray, gray, gray, 1.0-transp];  
81            stabilize;            stabilize;
82         }         }
83         rayN = rayN + rayStep;         rayN = rayN + rayStep;
84      }      }
85    
86      stabilize {      stabilize {
87  //       rgba = [gray, gray, gray, 1.0-transp];         rgba = [gray, gray, gray, 1.0-transp];
88      }      }
89    
90      /* render: output maxval */      /* render: output maxval */

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

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