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

SCM Repository

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

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

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

revision 827, Sat Apr 16 00:40:34 2011 UTC revision 1021, Sun May 1 15:26:58 2011 UTC
# Line 1  Line 1 
1    // process output with:
2    // unu reshape -i mip.txt -s 4 200 200 | overrgb -i - -b 0.1 0.15 0.2 -o - | unu quantize -b 8 -min 0 -max 255  -o vr-kcomp.png
3    
4  vec3 camEye = [25.0, 10.0, 8.0];  vec3 camEye = [25.0, 10.0, 8.0];
5  vec3 camAt = [0.0, 0.0, 0.0];  vec3 camAt = [0.0, 0.0, 0.0];
6  vec3 camUp = [0.0, 0.0, 1.0];  vec3 camUp = [0.0, 0.0, 1.0];
# Line 36  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;
     vec3 rayDir = normalize(rayVec);  
42    
43      real rayN = camVspNear;      real rayN = camVspNear;
44      // ########## BEGIN per-ray initialization      // ########## BEGIN per-ray initialization
45      real transp = 1.0;      real transp = 1.0;
46      real gray = 0.0;      real gray = 0.0;
     int myui = ui;  
     int myvi = vi;  
     field#1(3)[] myFc0 = Fc0;  
     field#1(3)[] myFc1 = Fc1;  
47      output vec4 rgba = [0.0, 0.0, 0.0, 0.0];      output vec4 rgba = [0.0, 0.0, 0.0, 0.0];
48      // ##########  END  per-ray initialization      // ##########  END  per-ray initialization
49    
# Line 57  Line 55 
55            real val = 0.0;            real val = 0.0;
56            vec3 norm = [0.0,0.0,0.0];            vec3 norm = [0.0,0.0,0.0];
57            // HEY (scoping BUG): the strand parameters (e.g. ui, vi) can't            // HEY (scoping BUG): the strand parameters (e.g. ui, vi) can't
58            // appear in conditionals            // appear in conditional below "if (ui + vi < imgResU)"
59            if (myui + myvi < imgResU) {            if (ui + vi < imgResU) {
60               val = myFc0@rayPos;               val = Fc0@rayPos;
61               norm = normalize(-∇myFc0@rayPos);               norm = normalize(-∇Fc0@rayPos);
62            } else {            } else {
63               val = myFc1@rayPos;               val = Fc1@rayPos;
64               norm = normalize(-∇myFc1@rayPos);               norm = normalize(-∇Fc1@rayPos);
65            }            }
66            if (val > valOpacMin) {  // we have some opacity            if (val > valOpacMin) {  // we have some opacity
67                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));

Legend:
Removed from v.827  
changed lines
  Added in v.1021

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