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"); |
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; |
12 |
|
|
13 |
|
// HEY (bug) : trying to do load and convolve in one line, twice, |
14 |
|
// to produce effect of four lines above, but get: |
15 |
|
// /usr/bin/gcc -std=gnu99 -m64 -c -DNDEBUG -g -O2 -Wformat -Wreturn-type -Wuninitialized -D_THREAD_SAFE -I/Users/gk/diderot/diderot/pure-cfg/src/include -I/Users/gk/diderot/teem/arch/darwin.64/include vr-curv-quad.c |
16 |
|
// vr-curv-quad.c:30: error: conflicting types for ‘G__t’ |
17 |
|
// vr-curv-quad.c:29: error: previous declaration of ‘G__t’ was here |
18 |
|
// vr-curv-quad.c: In function ‘Diderot_InitGlobals’: |
19 |
|
field#2(3)[] F = load("../data/quad-patches-pad.nrrd") ⊛ bspln3; |
20 |
|
field#0(2)[3] RGB = load("../data/hue.nhdr") ⊛ tent; |
21 |
|
|
22 |
// set camera, image, and rendering parameters |
// set camera, image, and rendering parameters |
23 |
vec3 camEye = [183.021, -411.857, 686.458]; |
vec3 camEye = [183.021, -411.857, 686.458]; |
65 |
vec3 pos = camEye + rayN*rayVec; |
vec3 pos = camEye + rayN*rayVec; |
66 |
if (inside (pos,F)) { |
if (inside (pos,F)) { |
67 |
real val = F(pos); |
real val = F(pos); |
68 |
|
if (val > valOpacMin) { // we have some opacity |
69 |
vec3 grad = -∇F(pos); |
vec3 grad = -∇F(pos); |
70 |
vec3 norm = normalize(grad); |
vec3 norm = normalize(grad); |
|
if (val > valOpacMin) { // we have some opacity |
|
71 |
// begin curvature computation |
// begin curvature computation |
72 |
tensor[3,3] H = -∇(∇F)(pos); |
tensor[3,3] H = -∇(∇F)(pos); |
73 |
tensor[3,3] P = identity[3] - norm⊗norm; |
tensor[3,3] P = identity[3] - norm⊗norm; |