|
@@ -17,6 +17,8 @@ export class StandardMaterialEditor extends BaseNode {
|
|
const opacity = new LabelElement( 'opacity' ).setInput( 1 );
|
|
const opacity = new LabelElement( 'opacity' ).setInput( 1 );
|
|
const metalness = new LabelElement( 'metalness' ).setInput( 1 );
|
|
const metalness = new LabelElement( 'metalness' ).setInput( 1 );
|
|
const roughness = new LabelElement( 'roughness' ).setInput( 1 );
|
|
const roughness = new LabelElement( 'roughness' ).setInput( 1 );
|
|
|
|
+ const emissive = new LabelElement( 'emissive' ).setInput( 3 );
|
|
|
|
+ const normal = new LabelElement( 'normal' ).setInput( 3 );
|
|
const position = new LabelElement( 'position' ).setInput( 3 );
|
|
const position = new LabelElement( 'position' ).setInput( 3 );
|
|
|
|
|
|
color.add( new ColorInput( material.color.getHex() ).onChange( ( input ) => {
|
|
color.add( new ColorInput( material.color.getHex() ).onChange( ( input ) => {
|
|
@@ -49,18 +51,24 @@ export class StandardMaterialEditor extends BaseNode {
|
|
opacity.onConnect( () => this.update(), true );
|
|
opacity.onConnect( () => this.update(), true );
|
|
metalness.onConnect( () => this.update(), true );
|
|
metalness.onConnect( () => this.update(), true );
|
|
roughness.onConnect( () => this.update(), true );
|
|
roughness.onConnect( () => this.update(), true );
|
|
- position.onConnect(() => this.update(), true );
|
|
|
|
|
|
+ emissive.onConnect( () => this.update(), true );
|
|
|
|
+ normal.onConnect( () => this.update(), true );
|
|
|
|
+ position.onConnect( () => this.update(), true );
|
|
|
|
|
|
this.add( color )
|
|
this.add( color )
|
|
.add( opacity )
|
|
.add( opacity )
|
|
.add( metalness )
|
|
.add( metalness )
|
|
.add( roughness )
|
|
.add( roughness )
|
|
|
|
+ .add( emissive )
|
|
|
|
+ .add( normal )
|
|
.add( position );
|
|
.add( position );
|
|
|
|
|
|
this.color = color;
|
|
this.color = color;
|
|
this.opacity = opacity;
|
|
this.opacity = opacity;
|
|
this.metalness = metalness;
|
|
this.metalness = metalness;
|
|
this.roughness = roughness;
|
|
this.roughness = roughness;
|
|
|
|
+ this.emissive = emissive;
|
|
|
|
+ this.normal = normal;
|
|
this.position = position;
|
|
this.position = position;
|
|
|
|
|
|
this.material = material;
|
|
this.material = material;
|
|
@@ -71,7 +79,7 @@ export class StandardMaterialEditor extends BaseNode {
|
|
|
|
|
|
update() {
|
|
update() {
|
|
|
|
|
|
- const { material, color, opacity, roughness, metalness, position } = this;
|
|
|
|
|
|
+ const { material, color, opacity, emissive, roughness, metalness, normal, position } = this;
|
|
|
|
|
|
color.setEnabledInputs( ! color.getLinkedObject() );
|
|
color.setEnabledInputs( ! color.getLinkedObject() );
|
|
opacity.setEnabledInputs( ! opacity.getLinkedObject() );
|
|
opacity.setEnabledInputs( ! opacity.getLinkedObject() );
|
|
@@ -79,11 +87,13 @@ export class StandardMaterialEditor extends BaseNode {
|
|
metalness.setEnabledInputs( ! metalness.getLinkedObject() );
|
|
metalness.setEnabledInputs( ! metalness.getLinkedObject() );
|
|
|
|
|
|
material.colorNode = color.getLinkedObject();
|
|
material.colorNode = color.getLinkedObject();
|
|
- material.opacityNode = opacity.getLinkedObject() || null;
|
|
|
|
|
|
+ material.opacityNode = opacity.getLinkedObject();
|
|
material.metalnessNode = metalness.getLinkedObject();
|
|
material.metalnessNode = metalness.getLinkedObject();
|
|
material.roughnessNode = roughness.getLinkedObject();
|
|
material.roughnessNode = roughness.getLinkedObject();
|
|
|
|
+ material.emissiveNode = emissive.getLinkedObject();
|
|
|
|
+ material.normalNode = normal.getLinkedObject();
|
|
|
|
|
|
- material.positionNode = position.getLinkedObject() || null;
|
|
|
|
|
|
+ material.positionNode = position.getLinkedObject();
|
|
|
|
|
|
material.dispose();
|
|
material.dispose();
|
|
|
|
|