DirectX 9 VolumeTexture HLSL Pixel Shader Problem in Windows 7

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
I have developed a medical application called MPR using DirectX 9.
In this program 2D images are combined to produce a volume texture.
Then an arbitrary 2D cut (in texture coordinate system) will be defined to generate a view from different point of view.
The problem is that in Windows XP it works fine. But in Windows 7 it will not work. The pixel shader is as below.
/*---------------------------------------------------------------*/

sampler S;

bool isMax = true;
bool isMin = false;
bool isAvg = false;

// Number of slices that must be accumulated
int n = 1;

// Determines differntial changes between each slice in texture coordinate system.
float3 d = {0, 0, 0};

vector main(float3 uvw: TEXCOORD0): COLOR0
{
int i, j = 0;
vector R = {0, 0, 0, 0};
if(isMin) R = vector(1, 1, 1, 1);

for(i = 0; i < n; i++)
{
float3 T = uvw + i * d;

// Check uvw is in [0, 1]
if(any(step(float3(0, 0, 0), T) - step(T, float3(1, 1, 1)))) continue;

vector V = tex3D(S, T);

if(isMax) R = max(R, V);
if(isMin) R = min(R, V);
if(isAvg) R += V;

j++;
}
if(j == 0) return vector(0, 0, 0, 0);
if(isAvg) R /= j;

return R;
}
/*---------------------------------------------------------------*/


I found that in Windows 7 uvw parameter will always have value (0, 0, 0).
Can anyone help me?

View the full article
 
Back
Top