bool is_empty(sampler2D s)
{
ivec2 size = textureSize(s, 0);
return size.x == 1 && size.x == 1;
}
void main()
{
vec2 uv = fragCoord;
vec3 c1 = texture( iChannel0, uv ).xyz;
vec3 c2 = is_empty(iChannel1) ? vec3(1.0) : texture(iChannel1, uv).xyz;
fragColor = vec4( c1 * c2, 1.0 );
}
use glBindTexture(GL_TEXTURE_2D, texID), is texture color;
use glBindTexture(GL_TEXTURE_2D, 0), is white color.
If sampler2D is empty, what is the return value of the OpenGL standard?
On my computer, the return value is ivec2 (1).
Does the standard specify a specific value for this return value? ivec2(0), ivec2(-1) or ivec2(-1)?