In the following code:
gl_FragColor = vColor * texture2D(u_Texture, v_TexCoordinate);
I noticed the default value returned by texture2D is a white (1,1,1,1) if u_Texture is unbound.
Is it safe to base my shader on this fact?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I wouldn’t have thought so.
I have seen other instances where the default value has been black. It could theoretically be any colour in the case where the memory used by the sampler is a section of uninitialised video memory, it depends on the opengl implementation