Pryme8 Posted October 27, 2017 Share Posted October 27, 2017 So when I create or bind a texture, how do I ensure it is equivalent to: gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image); specifically I want to make sure gl.UNSIGNED_BYTE is being used and gl.RGBA. Is this automatically handled when you create the texture? What are the defaults if so. Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 27, 2017 Share Posted October 27, 2017 gl.RGBA is used when the texture CAN have an alpha channel (for example png of gif). UNSINGNED_BYTE is used automatically (apart from Render Targets, which are a bit different). You can see the code here - https://github.com/BabylonJS/Babylon.js/blob/master/src/Engine/babylon.engine.ts#L2996 to understand how things are being set. 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.