Problems with colors and samples mixing in GLSL shaders

Hello all!

I have a slight issue here. I have a shader in which I pass the color and sample into the fragment. The texture renders fine, but when I want to draw a plain colored cube, it will be tainted black. This is because I am using mix(), mixing the color and texture.

I can fix this by passing in a uniform u_sampled, which will act as a switch between mixing the texture and color, or just the color. This is pretty messy, however… So my question is: how can I figure out if a texture (sample) is bound from the shader?

Thanks,
-wes :slight_smile: