AlexB 9 Posted June 30, 2017 Report Share Posted June 30, 2017 One of the killer new features in WebGL2 is the "sampler2DArray" uniform type. Apparently, we can use it to: Quote Texture arrays A texture array is very similar to a 3D texture except that each slice is considered a separate texture. All the slices have to be the same size but this is a great way to give a shader access to hundreds of textures even though it only has a relatively small number of texture units. You can select the slice in your shader EX: vec4 color = texture(someSampler2DArray, vec3(u, v, slice)); This would be a game changer for a project I'm working on, as it uses a shader which needs many textures as uniforms and we're hitting the limit regularly. Any thoughts on implementing this feature? Quote Link to post Share on other sites
Deltakosh 4315 Posted June 30, 2017 Report Share Posted June 30, 2017 We will But if you feel ok to implement it, please do:) Quote Link to post Share on other sites
AlexB 9 Posted June 30, 2017 Author Report Share Posted June 30, 2017 1 minute ago, Deltakosh said: We will But if you feel ok to implement it, please do:) We could look into it. Can you give a little clue into where that would happen in the code? The current project is using ThreeJS but this could be the reason to switch :-) Quote Link to post Share on other sites
Deltakosh 4315 Posted June 30, 2017 Report Share Posted June 30, 2017 If webgl2 is supported (check engine.webGLVersion), you should do something like this: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/babylon.effect.ts and also update (and do the actual call) inside engine like here: https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.engine.ts#L3669 Quote Link to post Share on other sites
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.