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

SCM Repository

[diderot] Diff of /branches/pure-cfg/test/vr-lite-cam.diderot
ViewVC logotype

Diff of /branches/pure-cfg/test/vr-lite-cam.diderot

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

revision 769, Thu Apr 7 20:30:51 2011 UTC revision 770, Thu Apr 7 20:42:13 2011 UTC
# Line 67  Line 67 
67    
68  strand RayCast (int ui, int vi)  strand RayCast (int ui, int vi)
69  {  {
70      real rayU = 2.0*camUmax*(real(ui) + 0.5)/real(imgResU) - camUmax;      real rayU = lerp(-camUmax, camUmax, -0.5, real(ui), real(imgResU)-0.5);
71      real rayV = 2.0*camVmax*(real(vi) + 0.5)/real(imgResV) - camVmax;      real rayV = lerp(-camVmax, camVmax, -0.5, real(vi), real(imgResV)-0.5);
72      vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;      vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;
73      vec3 rayDir = rayVec/|rayVec|;      vec3 rayDir = rayVec/|rayVec|;
74    
# Line 89  Line 89 
89  //          vec3 norm = -∇F@rayPos/|∇F@rayPos|;  //          vec3 norm = -∇F@rayPos/|∇F@rayPos|;
90            vec3 norm = normalize(-∇F@rayPos);            vec3 norm = normalize(-∇F@rayPos);
91            if (val > valOpacMin) {  // we have some opacity            if (val > valOpacMin) {  // we have some opacity
92                real opac =                real opac = min(1.0, lerp(0.0, 1.0, valOpacMin, val, valOpacMax));
                  1.0 if (val > valOpacMax)  
                  else (val - valOpacMin)/(valOpacMax - valOpacMin);  
93                real ld = dot(lightDir,norm);                real ld = dot(lightDir,norm);
94                real mat = (  phongKa                real mat = (  phongKa
95                            + phongKd*(ld if ld > 0.0 else 0.0)                            + phongKd*(ld if ld > 0.0 else 0.0)

Legend:
Removed from v.769  
changed lines
  Added in v.770

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