Pryme8 Posted November 22, 2017 Share Posted November 22, 2017 if I have a bool uniform in my shader how to I set its value? I'm guessing if I do the setFloat method that it might work. **EDIT** For now just used a float, but would prefer to use a boolean... and it does not look like there is a method for it. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 22, 2017 Share Posted November 22, 2017 This was talked about before. Think the problem for webGL is the lack of integers in javascript. Saw in another thread that setting is with gl.uniform1i: // true gl.uniform1i(gl.getUniformLocation("uMyBool"), 1); // false gl.uniform1i(gl.getUniformLocation("uMyBool"), 0); Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.