Budric
09-24-2007, 09:16 AM
Hi,
I have ATI x1600 PRO. I'm implementing a GPU ray cast volume renderer. I'm getting an error that I'm exceeding available number of texture instructions when my loop iteration count is over 127. If I remove my texture accessing operations the program runs in hardware. I thought the card supported loops and branches in the shader. I'm using latest catalyst driver. Any thoughts?
Here's my fragment shader:
uniform vec3 eyePos;
uniform float stepSize;
uniform sampler3D volumeTexture;
uniform sampler1D colourTable;
void main()
{
vec4 value;
vec3 position = gl_TexCoord[0].stp;
vec3 direction = position - eyePos;
direction = normalize(direction);
vec4 dst = vec4 (0,0,0,0);
for (int i = 0; i < 512; i++)
{
//get voxel, apply transfer function
value = texture3D(volumeTexture, position);
vec4 src = texture1D(colourTable,value.r);
//front to back compositing
dst = (1.0 - dst.a) * src + dst;
//advance position
position = position + direction * stepSize;
}
gl_FragColor = dst;
}
I have ATI x1600 PRO. I'm implementing a GPU ray cast volume renderer. I'm getting an error that I'm exceeding available number of texture instructions when my loop iteration count is over 127. If I remove my texture accessing operations the program runs in hardware. I thought the card supported loops and branches in the shader. I'm using latest catalyst driver. Any thoughts?
Here's my fragment shader:
uniform vec3 eyePos;
uniform float stepSize;
uniform sampler3D volumeTexture;
uniform sampler1D colourTable;
void main()
{
vec4 value;
vec3 position = gl_TexCoord[0].stp;
vec3 direction = position - eyePos;
direction = normalize(direction);
vec4 dst = vec4 (0,0,0,0);
for (int i = 0; i < 512; i++)
{
//get voxel, apply transfer function
value = texture3D(volumeTexture, position);
vec4 src = texture1D(colourTable,value.r);
//front to back compositing
dst = (1.0 - dst.a) * src + dst;
//advance position
position = position + direction * stepSize;
}
gl_FragColor = dst;
}