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

SCM Repository

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

Diff of /trunk/test/vr-kcomp.diderot

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

revision 1117, Thu May 5 04:55:18 2011 UTC revision 1118, Thu May 5 04:57:49 2011 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 vv = normalize(-rayVec);
43    
44      real rayN = camVspNear;      real rayN = camVspNear;
45      // ########## BEGIN per-ray initialization      // ########## BEGIN per-ray initialization
# Line 54  Line 55 
55            // ########## BEGIN per-sample code            // ########## BEGIN per-sample code
56            real val = 0.0;            real val = 0.0;
57            vec3 norm = [0.0,0.0,0.0];            vec3 norm = [0.0,0.0,0.0];
           // HEY (scoping BUG): the strand parameters (e.g. ui, vi) can't  
           // appear in conditional below "if (ui + vi < imgResU)"  
58            if (ui + vi < imgResU) {            if (ui + vi < imgResU) {
59               val = Fc0@rayPos;               val = Fc0@rayPos;
60               norm = normalize(-∇Fc0@rayPos);               norm = normalize(-∇Fc0@rayPos);
# Line 66  Line 65 
65            if (val > valOpacMin) {  // we have some opacity            if (val > valOpacMin) {  // we have some opacity
66                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));
67                real ld = lightDir • norm;                real ld = lightDir • norm;
68                real hd = norm • normalize(lightDir + normalize(camEye - rayPos));                real hd = norm • normalize(lightDir + vv);
69                real mat = (  phongKa                real mat = (  phongKa
70                            + phongKd*(ld if ld > 0.0 else 0.0)                            + phongKd*(ld if ld > 0.0 else 0.0)
71                            + phongKs*(hd^phongSp if hd > 0.0 else 0.0));                            + phongKs*(hd^phongSp if hd > 0.0 else 0.0));

Legend:
Removed from v.1117  
changed lines
  Added in v.1118

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