Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any possible way to use gl.TEXTURE_3D with webgl2? #649

Open
chwan1 opened this issue May 20, 2022 · 1 comment
Open

Any possible way to use gl.TEXTURE_3D with webgl2? #649

chwan1 opened this issue May 20, 2022 · 1 comment

Comments

@chwan1
Copy link

chwan1 commented May 20, 2022

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.

@deluksic
Copy link

deluksic commented Oct 26, 2022

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 Compatibility with webgl 2 #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants