I have a shader with an optional normal texture param. The shader samples the texture and uses a default normal on a "black" texel.
This works fine with gl.bindTexture(..., null) in raw webgl2, but when using twgl I am unable to bind the optional texture to null, with setUniforms or the uniform setter directly.
twglProgram.uniformSetters.uNormalTexture(null);
Here is a stack trace
Now of course I could (and perhaps should) pass another uniform instead of reading the default value and manually unbinding the texture unit but this seems like something that ought to be supported by twgl.
I believe the fix is as easy as changing the if statement to be textureOrPair == null || isTexture(...).
Hi,
I have a shader with an optional normal texture param. The shader samples the texture and uses a default normal on a "black" texel.
This works fine with gl.bindTexture(..., null) in raw webgl2, but when using twgl I am unable to bind the optional texture to null, with setUniforms or the uniform setter directly.
Here is a stack trace
Now of course I could (and perhaps should) pass another uniform instead of reading the default value and manually unbinding the texture unit but this seems like something that ought to be supported by twgl.
I believe the fix is as easy as changing the if statement to be
textureOrPair == null || isTexture(...)
.Thank you for your time.