13 |
{ 1.33333, -2.0, 1.0, -0.166667 }, // 1 .. 2 |
{ 1.33333, -2.0, 1.0, -0.166667 }, // 1 .. 2 |
14 |
}; |
}; |
15 |
|
|
16 |
__constant float4 eyeVec = (float4)(25,15,10,1); |
//__constant float4 eyeVec = (float4)(25,15,10,1); |
17 |
__constant float4 origVec = (float4)(8.83877,2.5911,7.65275,0); |
//__constant float4 origVec = (float4)(8.83877,2.5911,7.65275,0); |
18 |
__constant float4 cVec= (float4)(-0.0151831,0.0278357,0,0); |
//__constant float4 cVec= (float4)(-0.0151831,0.0278357,0,0); |
19 |
__constant float4 rVec = (float4)(0.0074887,0.00408474,-0.0305383,0); |
//__constant float4 rVec = (float4)(0.0074887,0.00408474,-0.0305383,0); |
20 |
__constant float stepSize = 0.1; |
__constant float4 eyeVec = (float4)(127.331, -1322.05, 272.53, 0); |
21 |
|
__constant float4 origVec = (float4)(122.835,17.7112,188.044, 0); |
22 |
|
__constant float4 cVec= (float4)(-0.00403611,-0.029826,-0.244066, 0); |
23 |
|
__constant float4 rVec = (float4)(-0.245595,-0.0112916,0.00544129, 0); |
24 |
|
__constant float stepSize = 0.5; |
25 |
__constant int s = 2; |
__constant int s = 2; |
26 |
|
|
27 |
|
|
47 |
t = (float4) (f.z + 1, f.z, f.z - 1, f.z -2); |
t = (float4) (f.z + 1, f.z, f.z - 1, f.z -2); |
48 |
hz = d + t * (c + t * (b + t*a)); |
hz = d + t * (c + t * (b + t*a)); |
49 |
|
|
50 |
float vy[4] = {0.0f,0.0f,0.0f,0.0f}; |
float vx[4]; |
51 |
float vz[4] = {0.0f,0.0f,0.0f,0.0f}; |
float vy[4]; |
52 |
|
|
53 |
for(int i = 1-s; i <= s; i++) { |
for(int k = 1-s; k <= s; k++) { // z is the slowest dimension |
54 |
for(int j = 1-s; j <= s; j++) { |
for(int j = 1-s; j <= s; j++) { // y is the medium dimension |
55 |
float4 v = (float4) ( |
int index = sAxis[0]*sAxis[1]*(n.z+k) + sAxis[0]*(n.y+j) + (n.x-1); |
56 |
img[((int)n.x+i) + sAxis[0]*(((int)n.y+j) + sAxis[1]*((int)n.z-1))], |
float4 v = (float4)(img[index], img[index+1], img[index+2], img[index+3]); |
57 |
img[((int)n.x+i) + sAxis[0]*(((int)n.y+j) + sAxis[1]*((int)n.z))], |
vx[j+s-1] = dot(v,hx); |
|
img[((int)n.x+i) + sAxis[0]*(((int)n.y+j) + sAxis[1]*((int)n.z+1))], |
|
|
img[((int)n.x+i) + sAxis[0]*(((int)n.y+j) + sAxis[1]*((int)n.z+2))]); |
|
|
vz[j+s-1] += dot(v,hz); |
|
58 |
} |
} |
59 |
vy[i+s-1] = dot ((float4) (vz[0],vz[1],vz[2],vz[3]),hy); |
vy[k+s-1] = dot ((float4) (vx[0],vx[1],vx[2],vx[3]),hy); |
60 |
} |
} |
61 |
|
|
62 |
probedVal = dot((float4) (vy[0],vy[1],vy[2],vy[3]),hx); |
probedVal = dot((float4) (vy[0],vy[1],vy[2],vy[3]),hz); |
63 |
|
|
64 |
return probedVal; |
return probedVal; |
65 |
|
|
83 |
pos.w = 0.0; |
pos.w = 0.0; |
84 |
dir.w = 0.0; |
dir.w = 0.0; |
85 |
|
|
86 |
for(t = 0.0; t < 40; t+= stepSize) |
for(t = 0.0; t < 200; t+= stepSize) |
87 |
{ |
{ |
88 |
pos = pos + stepSize * dir; |
pos = pos + stepSize * dir; |
89 |
|
|