uniform vec2 tab;
uniform sampler2d texureid;
…
int tmp = 0;
vec4 res = tex2D(textureid,TexCoord + tab[tmp]);
…
I have the error : “…texture indirections exceded…” and shader is used in software
but if i use this code :
uniform vec2 tab;
uniform sampler2d texureid;
…
vec4 res = tex2D(textureid,TexCoord + tab[0]);
…
then my shader is used in hardware
so what could be the explanation of this ?
and how can I use the first code in hardware (if I can ) ?
thanks
this could be a solution but not for my case : (for example)
uniform vec2 tab;
uniform sampler2d texureid;
uniform int value;
…
int tmp = value * 2;
vec4 res = tex2D(textureid,TexCoord + tab[tmp]);
…
in fact “tmp” is a non constant value
This won’t work on 9800Pro because the shader as you wrote it has to detect at runtime which tab[] to take. Radoen 9xxx graphic cards aren’t able to do that in hardware (Shader Model 3.0 is required for this).