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

SCM Repository

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

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

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

revision 1006, Thu Apr 28 21:19:33 2011 UTC revision 1009, Thu Apr 28 22:20:55 2011 UTC
# Line 5  Line 5 
5  // process output with:  // process output with:
6  // 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-curv.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-curv.png
7    
8  //image(3)[] img = load("../data/quad-patches-pad.nrrd");  image(3)[] img = load("../data/quad-patches-pad.nrrd");
 image(3)[] img = load("tmp.nrrd");  
9  field#2(3)[] F = img ⊛ bspln3;  field#2(3)[] F = img ⊛ bspln3;
10  image(2)[3] imgRGB = load("../data/hue.nhdr");  image(2)[3] imgRGB = load("../data/hue.nhdr");
11  field#0(2)[3] RGB = imgRGB ⊛ tent;  field#0(2)[3] RGB = imgRGB ⊛ tent;
# Line 48  Line 47 
47      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);
48      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);
49      vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;      vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;
50        vec3 toEye = normalize(-rayVec);
51    
52      real rayN = camVspNear;      real rayN = camVspNear;
53      real rayTransp = 1.0;      real rayTransp = 1.0;
# Line 76  Line 76 
76                real alpha = min(1.0, lerp(0.0, 1.0,                real alpha = min(1.0, lerp(0.0, 1.0,
77                                           valOpacMin, val, valOpacMax));                                           valOpacMin, val, valOpacMax));
78                real ld = max(0.0, norm • lightDir);                real ld = max(0.0, norm • lightDir);
79                real hd = max(0.0, norm • normalize(lightDir +                real hd = max(0.0, norm • normalize(lightDir + toEye));
                                                   normalize(camEye - pos)));  
80                // Phong shading                // Phong shading
81                vec3 pntRGB = (phongKa*matRGB                vec3 pntRGB = (phongKa*matRGB
82                               + phongKd*ld*modulate(matRGB, lightRGB)                               + phongKd*ld*modulate(matRGB, lightRGB)

Legend:
Removed from v.1006  
changed lines
  Added in v.1009

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