@@ -2,16 +2,18 @@ import NodeMaterial from './NodeMaterial.js';
2
2
import { varyingProperty } from '../../nodes/core/PropertyNode.js' ;
3
3
import { attribute } from '../../nodes/core/AttributeNode.js' ;
4
4
import { cameraProjectionMatrix } from '../../nodes/accessors/Camera.js' ;
5
- import { materialColor , materialLineScale , materialLineDashSize , materialLineGapSize , materialLineDashOffset , materialLineWidth } from '../../nodes/accessors/MaterialNode.js' ;
5
+ import { materialColor , materialLineScale , materialLineDashSize , materialLineGapSize , materialLineDashOffset , materialLineWidth , materialOpacity } from '../../nodes/accessors/MaterialNode.js' ;
6
6
import { modelViewMatrix } from '../../nodes/accessors/ModelNode.js' ;
7
7
import { positionGeometry } from '../../nodes/accessors/Position.js' ;
8
8
import { mix , smoothstep } from '../../nodes/math/MathNode.js' ;
9
9
import { Fn , float , vec2 , vec3 , vec4 , If } from '../../nodes/tsl/TSLBase.js' ;
10
10
import { uv } from '../../nodes/accessors/UV.js' ;
11
11
import { viewport } from '../../nodes/display/ScreenNode.js' ;
12
12
import { dashSize , gapSize } from '../../nodes/core/PropertyNode.js' ;
13
+ import { viewportSharedTexture } from '../../nodes/display/ViewportSharedTextureNode.js' ;
13
14
14
15
import { LineDashedMaterial } from '../LineDashedMaterial.js' ;
16
+ import { NoBlending } from '../../constants.js' ;
15
17
16
18
const _defaultValues = /*@__PURE__ */ new LineDashedMaterial ( ) ;
17
19
@@ -46,6 +48,8 @@ class Line2NodeMaterial extends NodeMaterial {
46
48
this . dashSizeNode = null ;
47
49
this . gapSizeNode = null ;
48
50
51
+ this . blending = NoBlending ;
52
+
49
53
this . setValues ( params ) ;
50
54
51
55
}
@@ -267,7 +271,7 @@ class Line2NodeMaterial extends NodeMaterial {
267
271
268
272
} ) ;
269
273
270
- this . fragmentNode = Fn ( ( ) => {
274
+ this . colorNode = Fn ( ( ) => {
271
275
272
276
const vUv = uv ( ) ;
273
277
@@ -383,6 +387,14 @@ class Line2NodeMaterial extends NodeMaterial {
383
387
384
388
} ) ( ) ;
385
389
390
+ if ( this . transparent ) {
391
+
392
+ const opacityNode = this . opacityNode ? float ( this . opacityNode ) : materialOpacity ;
393
+
394
+ this . outputNode = vec4 ( this . colorNode . rgb . mul ( opacityNode ) . add ( viewportSharedTexture ( ) . rgb . mul ( opacityNode . oneMinus ( ) ) ) , this . colorNode . a ) ;
395
+
396
+ }
397
+
386
398
}
387
399
388
400
0 commit comments