Jump to content
  • Advertisement
Sign in to follow this  
huaner

glsl shaderDesign

This topic is 4066 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!