Skip to content

Commit

Permalink
Multiply out the pixel ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed May 13, 2024
1 parent 1a597c6 commit fc29a0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/jsm/lines/LineSegments2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

}
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/lines/Wireframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

}
Expand Down

1 comment on commit fc29a0e

@aardgoose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use renderer.getViewport() rather than getCurrentViewport) which appears to return what you want (unmultiplied by pixel ratio).

Please sign in to comment.