Skip to content

Commit a707d46

Browse files
Allow user to flipY in 'rtt' textures (#293)
Noticed this and wanted to fix it real quick
2 parents 0722870 + 6e497ae commit a707d46

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

examples/tests/rtt-dimension.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ export default async function test({ renderer, testRoot }: ExampleSettings) {
185185
width: 100,
186186
height: 100,
187187
texture: nestedRTTNode1.texture,
188+
// Flip every other one of them
189+
textureOptions: {
190+
flipY: i % 2 === 1,
191+
},
188192
});
189193
}
190194

src/core/renderers/webgl/WebGlCoreRenderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@ export class WebGlCoreRenderer extends CoreRenderer {
282282
const flipX = textureOptions?.flipX ?? false;
283283
let flipY = textureOptions?.flipY ?? false;
284284

285-
// always flip Y for render textures
285+
// always flip flipY for render textures
286286
if (texture instanceof RenderTexture) {
287-
flipY = true;
287+
flipY = !flipY;
288288
}
289289

290290
let texCoordX1 = 0;
20.1 KB
Loading

0 commit comments

Comments
 (0)