Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
this.attenuationDistanceNode = null;
this.attenuationColorNode = null;

this.sheen = 0;
this.clearcoat = 0;
this.iridescence = 0;
this.transmission = 0;

this.setDefaultValues( defaultValues );

this.setValues( parameters );
Expand Down
21 changes: 17 additions & 4 deletions examples/jsm/nodes/materials/NodeMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,14 @@ class NodeMaterial extends ShaderMaterial {

}

setDefaultValues( values ) {
setDefaultValues( material ) {

// This approach is to reuse the native refreshUniforms*
// and turn available the use of features like transmission and environment in core

for ( const property in values ) {
for ( const property in material ) {

const value = values[ property ];
const value = material[ property ];

if ( this[ property ] === undefined ) {

Expand All @@ -272,7 +272,20 @@ class NodeMaterial extends ShaderMaterial {

}

Object.assign( this.defines, values.defines );
Object.assign( this.defines, material.defines );

const descriptors = Object.getOwnPropertyDescriptors( material.constructor.prototype );

for ( const key in descriptors ) {

if ( Object.getOwnPropertyDescriptor( this.constructor.prototype, key ) === undefined &&
descriptors[ key ].get !== undefined ) {

Object.defineProperty( this.constructor.prototype, key, descriptors[ key ] );

}

}

}

Expand Down
Binary file modified examples/screenshots/webgl_nodes_loader_gltf_iridescence.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.