Skip to content

WebGLTextures: Prevent flipping image bitmaps.#33073

Merged
Mugen87 merged 3 commits into
mrdoob:devfrom
Mugen87:dev5
Feb 27, 2026
Merged

WebGLTextures: Prevent flipping image bitmaps.#33073
Mugen87 merged 3 commits into
mrdoob:devfrom
Mugen87:dev5

Conversation

@Mugen87

@Mugen87 Mugen87 commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

Fixed #16144.

Description

There is an edge case in WebGLTextures that currently does not work as expected. Image bitmaps might be resized when they exceed the maximum texture size of a device. In this case, they end up as an canvas image. If that happens, image bitmaps might be unexpectedly flipped because certain gl.pixelStorei() calls now have an effect which are normally ignored with image bitmaps. The PR makes sure to never set UNPACK_FLIP_Y_WEBGL, UNPACK_PREMULTIPLY_ALPHA_WEBGL and UNPACK_COLORSPACE_CONVERSION_WEBGL when the input is ImageBitmap because these configuration parameters must be specified when loading/crearting the image bitmap via setOptions(), see:

https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#the-imagebitmap-interface

@github-actions

github-actions Bot commented Feb 26, 2026

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 359.49
85.34
359.57
85.37
+75 B
+26 B
WebGPU 626.57
174.15
626.57
174.15
+0 B
+0 B
WebGPU Nodes 625.15
173.9
625.15
173.9
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 491.23
119.75
491.31
119.78
+75 B
+35 B
WebGPU 700.2
189.15
700.2
189.15
+0 B
+0 B
WebGPU Nodes 649.41
176.51
649.41
176.51
+0 B
+0 B

@Mugen87 Mugen87 added this to the r184 milestone Feb 26, 2026
@Mugen87 Mugen87 closed this Feb 26, 2026
@Mugen87 Mugen87 reopened this Feb 26, 2026
@Mugen87 Mugen87 merged commit cc6932e into mrdoob:dev Feb 27, 2026
10 checks passed
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

Successfully merging this pull request may close these issues.

Non POT ImageBitmap texture can be upside down

1 participant