Skip to content

Commit

Permalink
Nodes: Line2NodeMaterial - simplify extension (#28160)
Browse files Browse the repository at this point in the history
* move  setupShader to setup

* fix update signalling

---------

Co-authored-by: aardgoose <angus.sawyer@email.com>
  • Loading branch information
aardgoose and aardgoose committed Apr 19, 2024
1 parent edc383d commit ec498d0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions examples/jsm/nodes/materials/Line2NodeMaterial.js
Expand Up @@ -43,9 +43,15 @@ class Line2NodeMaterial extends NodeMaterial {
this.dashSizeNode = null;
this.gapSizeNode = null;

this.setValues( params );

}

setup( builder ) {

this.setupShaders();

this.setValues( params );
super.setup( builder );

}

Expand Down Expand Up @@ -371,8 +377,6 @@ class Line2NodeMaterial extends NodeMaterial {

} )();

this.needsUpdate = true;

}


Expand All @@ -387,7 +391,7 @@ class Line2NodeMaterial extends NodeMaterial {
if ( this.useWorldUnits !== value ) {

this.useWorldUnits = value;
this.setupShaders();
this.needsUpdate = true;

}

Expand All @@ -405,7 +409,7 @@ class Line2NodeMaterial extends NodeMaterial {
if ( this.useDash !== value ) {

this.useDash = value;
this.setupShaders();
this.needsUpdate = true;

}

Expand All @@ -423,7 +427,7 @@ class Line2NodeMaterial extends NodeMaterial {
if ( this.useAlphaToCoverage !== value ) {

this.useAlphaToCoverage = value;
this.setupShaders();
this.needsUpdate = true;

}

Expand Down

0 comments on commit ec498d0

Please sign in to comment.