regl
regl copied to clipboard
Any possible way to use gl.TEXTURE_3D with webgl2?
I'd like to port this using regl, since the functional nature of regl makes a good developing experience.
I've wrapped webgl2 using the technique in #561. And I'm wondering is there any way I can use texture 3d under this wrapper? Perhaps a custom binding of 3d texture to shader uniform is possible?
Currently, I have uniform mediump sampler3D tex; in my shader.
I started a fork in which I implement regl.texture3D. You can also use EXT_texture_norm16 extension with (for now only) r16 and r16_snorm texture formats.
It is a WIP, but it works for our needs.
- use the WebGL2 wrapper described in #561
- write your shaders with
#version 300 es(this introduces a ton of changes! Read up on WebGL2 vs WebGL1 differences) - add
precision <precision> sampler3D;
https://github.com/deluksic/regl