-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Add note about ignored texture properties for ImageBitmap to ImageBitmapLoader document #15945
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
Conversation
| </p> | ||
|
|
||
| <p> | ||
| Note that [page:Texture.flipY .flipY] and [page:Texture.premultiplyAlpha .premultiplyAlpha] properties of [page:Texture] |
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.
I would shortly note why both properties are ignored (because unlike normal images they are needed when the bitmap is created; not at texture upload time).
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.
So, how about adding
... are ignored because corresponding UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL parameters for gl.pixelStorei() are ignored if image source is ImageBitmap.
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.
It seems more important to me to differentiate between creation and upload time of the texture. In context of ImageBitmap, you need these configuration parameters when creating the bitmap. In all other cases, you need them when the texture is uploaded to the GPU. That's the important bit users should aware of and the reason why setting Texture.flipY and Texture.premultiplyAlpha after the creation process are ignored.
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.
How about this
Note that Texture.flipY and Texture.premultiplyAlpha with ImageBitmap are ignored. ImageBitmap needs these configuration on bitmap creation unlike regular images need them on uploading to GPU. You need to set the equivalent options via ImageBitmapLoader.setOptions() instead. Refer to WebGL specification for the detail.
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.
Sounds good 👍!
|
Updated. |
|
Thanks! |
.flipYand.premultiplyAlphaofTextureproperties withImageBitmapare ignored becauseUNPACK_FLIP_Y_WEBGL,UNPACK_PREMULTIPLY_ALPHA_WEBGL(, andUNPACK_COLORSPACE_CONVERSION_WEBGL) forgl.pixelStoreiare ignored if the image source isImageBitmap.https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.10
I'd like to add the note about it to
ImageBitmapLoaderdocument. Please feel free to correct the sentences if looking weird because English isn't my first language.