From fc29a0e516850c2a99aa1f5793d4c736efe0c3e3 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Mon, 13 May 2024 12:59:57 +0900 Subject: [PATCH] Multiply out the pixel ratio --- examples/jsm/lines/LineSegments2.js | 2 +- examples/jsm/lines/Wireframe.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/jsm/lines/LineSegments2.js b/examples/jsm/lines/LineSegments2.js index c8f35de0e235cf..b8954b257c45b4 100644 --- a/examples/jsm/lines/LineSegments2.js +++ b/examples/jsm/lines/LineSegments2.js @@ -362,7 +362,7 @@ class LineSegments2 extends Mesh { if ( this.material.uniforms.resolution ) { - renderer.getCurrentViewport( _viewport ); + renderer.getCurrentViewport( _viewport ).multiplyScalar( 1 / renderer.getPixelRatio() ); this.material.uniforms.resolution.value.set( _viewport.z, _viewport.w ); } diff --git a/examples/jsm/lines/Wireframe.js b/examples/jsm/lines/Wireframe.js index ffbeb2f128d5ad..17332013dea39d 100644 --- a/examples/jsm/lines/Wireframe.js +++ b/examples/jsm/lines/Wireframe.js @@ -57,7 +57,7 @@ class Wireframe extends Mesh { if ( this.material.uniforms.resolution ) { - renderer.getCurrentViewport( _viewport ); + renderer.getCurrentViewport( _viewport ).multiplyScalar( 1 / renderer.getPixelRatio() ); this.material.uniforms.resolution.value.set( _viewport.z, _viewport.w ); }