Skip to content

Commit 8173be8

Browse files
authored
Line2NodeMaterial: Align wide lines with WebGLRenderer version. (#32234)
1 parent 82834f0 commit 8173be8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/materials/nodes/Line2NodeMaterial.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { positionGeometry } from '../../nodes/accessors/Position.js';
88
import { mix, smoothstep } from '../../nodes/math/MathNode.js';
99
import { Fn, float, vec2, vec3, vec4, If } from '../../nodes/tsl/TSLBase.js';
1010
import { uv } from '../../nodes/accessors/UV.js';
11-
import { viewport } from '../../nodes/display/ScreenNode.js';
11+
import { screenDPR, viewport } from '../../nodes/display/ScreenNode.js';
1212
import { viewportSharedTexture } from '../../nodes/display/ViewportSharedTextureNode.js';
1313

1414
import { LineDashedMaterial } from '../LineDashedMaterial.js';
@@ -300,7 +300,7 @@ class Line2NodeMaterial extends NodeMaterial {
300300
offset.assign( offset.mul( materialLineWidth ) );
301301

302302
// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
303-
offset.assign( offset.div( viewport.w ) );
303+
offset.assign( offset.div( viewport.w.div( screenDPR ) ) );
304304

305305
// select end
306306
clip.assign( positionGeometry.y.lessThan( 0.5 ).select( clipStart, clipEnd ) );

0 commit comments

Comments
 (0)