-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
WebGLCapabilities: add textureTypeReadable()
and textureFormatReadable()
#28087
WebGLCapabilities: add textureTypeReadable()
and textureFormatReadable()
#28087
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
d1785dd
to
b5cc804
Compare
b5cc804
to
0b0b695
Compare
canReadTextureType()
and canReadPixelFormat()
.
@Mugen87 is there any documentation to update somewhere ? |
No, there isn't a doc page for Apart from that, I'm curious to see if other devs prefer an API on The PR in its current state is fine in context of |
0b0b695
to
0aae781
Compare
0aae781
to
3955116
Compare
canReadTextureType()
and canReadPixelFormat()
.textureTypeReadable()
and textureFormatReadable()
Fixed #28086
Description
WebGL only supports one texture type for reading:
UnsignedByteType
, and only one pixel format:RGBAFormat
. Any other combination is optional and implementation dependent.This PR exposes 2 conditional checks that previously ocurred in
WebGLRenderer.readRenderTargetPixels()
:as two publicly accessible methods on
WebGLCapabilities
:textureTypeReadable()
textureFormatReadable()
To be able to determine if the render target can be read, we can now use those two methods. If at least one of them returns
false
, we might have the opportunity to convert the texture to another format before callingreadRenderTargetPixels()
.This contribution is funded by Oslandia