huaner
05-07-2007, 12:40 AM
Hi:
i downloaded IDE of shaderDesgin. but i came across some questions. the code as fellow:
vertex:
void main()
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = gl_MultiTexCoord0;
gl_Position = ftransform();
}
fragment:
uniform sampler2D TextureUnit0;
uniform sampler2D TextureUnit1;
void main()
{
vec4 value1 = texture2D(TextureUnit0, gl_TexCoord[0]);
vec4 value2 = texture2D(TextureUnit1, gl_TexCoord[1]);
gl_FragColor = value1;
// gl_FragColor = value2;
}the problem is :that i found the effect of value2 and value1 is the same. whether the load texture is wrong or texture coordninate? but when put the shader in procedure, it's all right.May i didn't bind the second texture ?
thanks
i downloaded IDE of shaderDesgin. but i came across some questions. the code as fellow:
vertex:
void main()
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = gl_MultiTexCoord0;
gl_Position = ftransform();
}
fragment:
uniform sampler2D TextureUnit0;
uniform sampler2D TextureUnit1;
void main()
{
vec4 value1 = texture2D(TextureUnit0, gl_TexCoord[0]);
vec4 value2 = texture2D(TextureUnit1, gl_TexCoord[1]);
gl_FragColor = value1;
// gl_FragColor = value2;
}the problem is :that i found the effect of value2 and value1 is the same. whether the load texture is wrong or texture coordninate? but when put the shader in procedure, it's all right.May i didn't bind the second texture ?
thanks