Skip to content

Commit 0195417

Browse files
authored
WebGLBackend: Fix ArrayCamera pixel ratio (#30338)
1 parent 785add5 commit 0195417

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/renderers/webgl-fallback/WebGLBackend.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,11 +1104,16 @@ class WebGLBackend extends Backend {
11041104

11051105
const vp = subCamera.viewport;
11061106

1107+
const x = vp.x * pixelRatio;
1108+
const y = vp.y * pixelRatio;
1109+
const width = vp.width * pixelRatio;
1110+
const height = vp.height * pixelRatio;
1111+
11071112
state.viewport(
1108-
Math.floor( vp.x * pixelRatio ),
1109-
Math.floor( ( renderObject.context.height - vp.height - vp.y ) * pixelRatio ),
1110-
Math.floor( vp.width * pixelRatio ),
1111-
Math.floor( vp.height * pixelRatio )
1113+
Math.floor( x ),
1114+
Math.floor( renderObject.context.height - height - y ),
1115+
Math.floor( width ),
1116+
Math.floor( height )
11121117
);
11131118

11141119
state.bindBufferBase( gl.UNIFORM_BUFFER, cameraIndexData.index, cameraData.indexesGPU[ i ] );

0 commit comments

Comments
 (0)