OpenGL ES 2.0 GLSL texture2D return value when unbound
问题 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? 回答1: 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