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 914, Thu Apr 21 18:56:39 2011 UTC revision 915, Thu Apr 21 19:00:44 2011 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 320 240 | overrgb -i - -b 0.1 0.15 0.2 -o - | unu quantize -b 8 -min 0 -max 255  -o vr-lite-cam.png  // 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
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 15  Line 15 
15  real camNear = -5.0;  real camNear = -5.0;
16  real camFar = 5.0;  real camFar = 5.0;
17  real camFOV = 16.0;  real camFOV = 16.0;
18  int imgResU = 320;  int imgResU = 480;
19  int imgResV = 240;  int imgResV = 345;
20  real rayStep = 0.1;  real rayStep = 0.1;
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
# Line 28  Line 28 
28  //real camNear = -78.0;  //real camNear = -78.0;
29  //real camFar = 78.0;  //real camFar = 78.0;
30  //real camFOV = 5.0;  //real camFOV = 5.0;
 ////int imgResU = 640;  
 ////int imgResV = 480;  
31  //int imgResU = 480;  //int imgResU = 480;
32  //int imgResV = 345;  //int imgResV = 345;
 ////int imgResU = 320;  
 ////int imgResV = 240;  
33  //real rayStep = 0.1;  //real rayStep = 0.1;
 //real rayStep = 0.5;  
34  //real valOpacMin = 400.0;        // 400.0 for skin, 1150.0 for bone  //real valOpacMin = 400.0;        // 400.0 for skin, 1150.0 for bone
35  //real valOpacMax = 700.0;        // 700.0 for skin, 1450.0 for bone  //real valOpacMax = 700.0;        // 700.0 for skin, 1450.0 for bone
36    
# Line 73  Line 68 
68      // ########## BEGIN per-ray initialization      // ########## BEGIN per-ray initialization
69      real rayTransp = 1.0;      real rayTransp = 1.0;
70      vec3 rayRGB = [0.0, 0.0, 0.0];      vec3 rayRGB = [0.0, 0.0, 0.0];
71      output vec4 rgba = [0.0, 0.0, 0.0, 0.0];      output vec4 outRGBA = [0.0, 0.0, 0.0, 0.0];
72      // ##########  END  per-ray initialization      // ##########  END  per-ray initialization
73    
74      update      update
# Line 88  Line 83 
83                real alpha = min(1.0, lerp(0.0, 1.0, valOpacMin, val, valOpacMax));                real alpha = min(1.0, lerp(0.0, 1.0, valOpacMin, val, valOpacMax));
84                real ld = max(0.0, norm • lightDir);                real ld = max(0.0, norm • lightDir);
85                real hd = max(0.0, norm • normalize(lightDir + normalize(camEye - rayPos)));                real hd = max(0.0, norm • normalize(lightDir + normalize(camEye - rayPos)));
86                // contrived assignment of RGB from XYZ                // contrived assignment of RGB from XYZ, only sensible
87                  // for txs-pad3.nrrd, not for vfrhand-nohip.nhdr!!
88                vec3 matRGB = [lerp(0.2, 1.0, 1.0, rayPos[0], 8.0),                vec3 matRGB = [lerp(0.2, 1.0, 1.0, rayPos[0], 8.0),
89                               lerp(0.2, 1.0, 1.0, rayPos[1], 8.0),                               lerp(0.2, 1.0, 1.0, rayPos[1], 8.0),
90                               lerp(0.2, 1.0, 1.0, rayPos[2], 8.0)];                               lerp(0.2, 1.0, 1.0, rayPos[2], 8.0)];
# Line 102  Line 98 
98         }         }
99         if (rayTransp < 0.01) {  // early ray termination         if (rayTransp < 0.01) {  // early ray termination
100             rayTransp = 0.0;             rayTransp = 0.0;
101             rgba = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0-rayTransp]; /* FIXME */             outRGBA = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0-rayTransp]; /* FIXME */
102             stabilize;             stabilize;
103         }         }
104         if (rayN > camVspFar) {         if (rayN > camVspFar) {
105             rgba = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0-rayTransp]; /* FIXME */             outRGBA = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0-rayTransp]; /* FIXME */
106             stabilize;             stabilize;
107         }         }
108         rayN = rayN + rayStep;         rayN = rayN + rayStep;
109      }      }
110    
111      stabilize {      stabilize {
112  //     rgba = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0-rayTransp];  //     outRGBA = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0-rayTransp];
113      }      }
114    
115  }  }

Legend:
Removed from v.914  
changed lines
  Added in v.915

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