Sign in to follow this  
huaner

glsl shaderDesign

Recommended Posts

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? thanks!

Share this post


Link to post
Share on other sites
Can you just verify the values that you are setting to uniforms 'TextureUnit0' & 'TextureUnit1' ? I think, you are setting same value (0) for both of them. Actually, I have not used the IDE ShaderDesign. So I do not know how do you set variables in that !!!

Regards,
KumGame

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this