Skip to content

Fix painter example render target orientation across APIs - #9108

Merged
mvaligursky merged 1 commit into
mainfrom
mv-painter-origin
Jul 23, 2026
Merged

Fix painter example render target orientation across APIs#9108
mvaligursky merged 1 commit into
mainfrom
mv-painter-origin

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

The painter example rendered brush strokes into a render target created with the default (API-native) orientation, then sampled that texture with mesh UVs on the display box. Since native storage differs between WebGL2 (bottom-up) and WebGPU (top-down), the painted result appeared vertically mirrored between the two backends.

Fix: create the render target with origin: RENDERTARGET_ORIGIN_TOP so the painted texture is stored in image orientation on both APIs, making the example render identically everywhere. This also models the recommended pattern (use origin for render targets sampled as textures) now that RenderTarget#flipY is deprecated.

Changes:

  • examples/graphics/painter: render target created with origin: RENDERTARGET_ORIGIN_TOP.

Verified on WebGL2 and WebGPU (identical result after the fix).

The painter example rendered brush strokes into a render target created
with the default (API-native) orientation, then sampled that texture with
mesh UVs on the display box. Because native storage differs between WebGL2
(bottom-up) and WebGPU (top-down), the painted result appeared vertically
mirrored between the two backends.

Set the render target origin to RENDERTARGET_ORIGIN_TOP so the painted
texture is stored in image orientation on both APIs, making the example
render identically everywhere.
@github-actions

Copy link
Copy Markdown

Build size report

This PR does not change the size of the minified bundles.

Bundle Minified Gzip Brotli
playcanvas.min.js 2321.6 KB — 597.2 KB — 464.6 KB —
playcanvas.min.mjs 2319.0 KB — 596.1 KB — 463.8 KB —

@mvaligursky
mvaligursky merged commit 2b43597 into main Jul 23, 2026
10 checks passed
@mvaligursky
mvaligursky deleted the mv-painter-origin branch July 23, 2026 14:35
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.

1 participant