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.diderot
ViewVC logotype

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

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

revision 770, Thu Apr 7 20:42:13 2011 UTC revision 772, Thu Apr 7 20:54:31 2011 UTC
# Line 25  Line 25 
25  strand RayCast (int row, int col)  strand RayCast (int row, int col)
26  {  {
27      vec3 pos = orig + real(row)*rVec + real(col)*cVec;      vec3 pos = orig + real(row)*rVec + real(col)*cVec;
28      vec3 dir = (pos - eye)/|pos - eye|;      vec3 dir = normalize(pos - eye);
29      real t = 0.0;      real t = 0.0;
30      real transp = 1.0;      real transp = 1.0;
31      real gray = 0.0;      real gray = 0.0;
# Line 36  Line 36 
36          pos = pos + stepSz*dir;          pos = pos + stepSz*dir;
37          if (inside (pos,F)) {          if (inside (pos,F)) {
38              real val = F@pos;              real val = F@pos;
39              vec3 grad = ∇F@pos;              vec3 norm = -normalize(∇F@pos);
             vec3 norm = -grad/|grad|;  
40              if (val > valOpacMin) {  // we have some opacity              if (val > valOpacMin) {  // we have some opacity
41                  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));
42                  gray = gray + transp*opac*max(0.0, -dir • norm);                  gray = gray + transp*opac*max(0.0, -dir • norm);

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

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