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

SCM Repository

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

Diff of /branches/vis12/test/vr-lite-cam/vr-lite-cam.diderot

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

trunk/test/vr-lite-cam.diderot revision 1383, Thu Jun 23 20:24:04 2011 UTC branches/vis12/test/vr-lite-cam/vr-lite-cam.diderot revision 1927, Sat Jun 23 18:09:16 2012 UTC
# Line 6  Line 6 
6  // The main thing missing from this is a more general transfer function  // The main thing missing from this is a more general transfer function
7  //  //
8  // process output with:  // process output with:
9  // unu reshape -i mip.txt -s 4 480 345 | overrgb -i - -b 0.1 0.15 0.2 -g 1.2 -o - | unu quantize -b 8 -min 0 -max 255  -o vr-lite-cam.png  // overrgb -i out.nrrd -b 0.1 0.15 0.2 -g 1.2 -o - | unu quantize -b 8 -min 0 -max 255  -o vr-lite-cam.png
10    
11  //string dataFile = "../data/txs-pad3.nrrd";  //string dataFile = "../data/txs-pad3.nrrd";
12  //vec3 camEye = [25.0, 15.0, 10.0];  //vec3 camEye = [25.0, 15.0, 10.0];
# Line 21  Line 21 
21  //real valOpacMin = 0.15;          // highest value with opacity 0.0  //real valOpacMin = 0.15;          // highest value with opacity 0.0
22  //real valOpacMax = 0.20;          // lowest value with opacity 1.0  //real valOpacMax = 0.20;          // lowest value with opacity 1.0
23    
 string dataFile = "../data/vfrhand-nohip.nhdr";  
24  vec3 camEye = [127.331, -1322.05, 272.53];  vec3 camEye = [127.331, -1322.05, 272.53];
25  vec3 camAt = [63.0, 82.6536, 98.0];  vec3 camAt = [63.0, 82.6536, 98.0];
26  vec3 camUp = [0.9987, 0.0459166, -0.0221267];  vec3 camUp = [0.9987, 0.0459166, -0.0221267];
# Line 52  Line 51 
51  real phongKs = 0.45;  real phongKs = 0.45;
52  real phongSp = 50.0;  real phongSp = 50.0;
53    
54  //field#4(3)[] F =  bspln5 ⊛ load(dataFile);  //field#4(3)[] F =  bspln5 ⊛ image(dataFile);
55  field#2(3)[] F =  bspln3 ⊛ load(dataFile);  field#2(3)[] F =  bspln3 ⊛ image("../../data/vfrhand-nohip.nhdr");
56  //field#1(3)[] F = ctmr ⊛ load(dataFile);  //field#1(3)[] F = ctmr ⊛ image(dataFile);
57  //field#1(3)[] F = c1tent ⊛ load(dataFile);  //field#1(3)[] F = c1tent ⊛ image(dataFile);
58    
59  strand RayCast (int ui, int vi)  strand RayCast (int ui, int vi)
60  {  {
# Line 93  Line 92 
92  //                             + phongKd*ld*modulate(matRGB, lightRGB)  //                             + phongKd*ld*modulate(matRGB, lightRGB)
93  //                             + phongKs*hd^phongSp*lightRGB);  //                             + phongKs*hd^phongSp*lightRGB);
94  //              rayRGB += rayTransp*alpha*pntRGB;  //              rayRGB += rayTransp*alpha*pntRGB;
95                  real mat = lerp(0.2, 1.0, 1.0, rayPos[0], 8.0);  //              real mat = lerp(0.2, 1.0, 1.0, rayPos[0], 8.0);
96                  real pnt = phongKa * mat                  real pnt = phongKa
97                           + phongKd * ld * mat                           + phongKd * ld
98                           + phongKs * hd^phongSp;                           + phongKs * hd^phongSp;
99                  rayGrey += rayTransp*alpha*pnt;                  rayGrey += rayTransp*alpha*pnt;
100                  rayTransp = rayTransp*(1.0 - alpha);                  rayTransp = rayTransp*(1.0 - alpha);
# Line 104  Line 103 
103         }         }
104         if (rayTransp < 0.01) {  // early ray termination         if (rayTransp < 0.01) {  // early ray termination
105             rayTransp = 0.0;             rayTransp = 0.0;
 //           outRGBA = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0-rayTransp]; /* FIXME */  
            outRGBA = [rayGrey, rayGrey, rayGrey, 1.0-rayTransp]; /* FIXME */  
106             stabilize;             stabilize;
107         }         }
108         if (rayN > camVspFar) {         if (rayN > camVspFar) {
 //           outRGBA = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0-rayTransp]; /* FIXME */  
            outRGBA = [rayGrey, rayGrey, rayGrey, 1.0-rayTransp]; /* FIXME */  
109             stabilize;             stabilize;
110         }         }
111         rayN += rayStep;         rayN += rayStep;
112      }      }
113    
114      stabilize {      stabilize {
115  //     outRGBA = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0-rayTransp];          outRGBA = [rayGrey, rayGrey, rayGrey, 1.0-rayTransp];
116      }      }
117    
118  }  }

Legend:
Removed from v.1383  
changed lines
  Added in v.1927

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