kzhsw
April 18, 2025, 5:12am
1
Engine: WebGL2
Version: 8.3.1
Browser: Chrome
Hardware: NV GTX 1050
Playground
Steps to reproduce:
Open the “Inspector”
Click textures → “no name”
Look at “Preview”
Expected:
All layers can be previewed
Actual:
All previews are black, and there is no layer selection available
Related:
With the latest ImageDecoder API it is possible to decode gif image to frames without external deps.
The sample2DArray can hold at least 256 frames per spec, and up to 2048 frames on some modern computer, that far from enough for videos, but fairly enough for gif images. (Modern AI said a typical gif contains less than 100 frames)
Note that this is just a demo, so frame count is fixed in shader and frame delay is also not considered.
Engine: WebGL2
Version: 8.3.1
Another Image:
And a lo…
kzhsw
April 18, 2025, 6:15am
3
Reading from multi layer texture is a bit complex since there is no direct API doing this, you will need a to create a framebuffer, attach a single layer texture to it, draw one layer of the texture 2d array to the framebuffer, and read from the single layer texture with readPixels
.
That could be a feature request for sure. Having a listbox to select which texture ID to render
2 Likes
kzhsw
April 21, 2025, 6:58am
5
Feel free to move it but before this implemented, maybe there should be some notice like “Preview texture array not supported yet” instead.
That sounds like a good plan (wanna give it a try?)