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
WebGL Texture2d array #5754
WebGL Texture2d array #5754
Conversation
Is there a new public API related to this PR? |
@Maksims I updated the first post. I hope it is more clear now. |
Related issue: #4265 |
Ideally Texture.lock would allow us to lock individual slice as well, but that would be done in a separate PR. |
Yeah, totally agree there are a lot of cases where it would make sense to be able to upload individual slices. I will add a separate PR for that as well after this is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me. Any thoughts @willeastcott @slimbuck ?
Adds support for WebGL2 TEXTURE2D_ARRAY
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.
This PR adds support for 2d texture arrays useful in a lot of scenarios but most commonly for terrain rendering.
It introduces a new uniform type
UNIFORMTYPE_TEXTURE2D_ARRAY
and sampler typesampler2DArray
ca be used now inside the shaders.There are also a few small additions to the
options
used when constructing apc.Texture
The PR also adds a new simple example
Texture Array
that shows how a 2D Array texture can be created and used.There is no WebGPU support for this at the moment.
The textures used are from https://polyhaven.com/ and are public domain (CCO license).
I'm pretty sure the PR is rough around the edges and I'm looking forward for PlayCanvas team's feedback.