Skip to content

Commit e52cf02

Browse files
committed
improve performance - possible cachekey issue
1 parent 9119a50 commit e52cf02

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

examples/jsm/materials/ProceduralWood.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,21 @@ export function GenerateWoodMaterial( params ) {
418418

419419
const material = new THREE.MeshPhysicalNodeMaterial();
420420

421-
Object.assign( material, params );
421+
for ( const key in params ) {
422+
423+
if ( key === 'genus' || key === 'finish' ) continue;
424+
425+
if ( typeof params[ key ] === 'string' ) {
426+
427+
material[ key ] = new THREE.Color( params[ key ] );
428+
429+
} else {
430+
431+
material[ key ] = params[ key ];
432+
433+
}
434+
435+
}
422436

423437
material.colorNode = colorNode;
424438
material.clearcoatNode = params.clearcoat;

0 commit comments

Comments
 (0)