From 1121a0ae4ba01507920595ab32609c48c280b628 Mon Sep 17 00:00:00 2001 From: Gourav NSS Date: Sat, 8 Nov 2025 10:37:41 +0530 Subject: [PATCH 1/2] ShaderMaterial: Fix copy method to include missing properties The copy method was missing several properties that are defined in the constructor: - linewidth - forceSinglePass - defaultAttributeValues - index0AttributeName - uniformsNeedUpdate This fix ensures all ShaderMaterial properties are properly copied when cloning materials. --- src/materials/ShaderMaterial.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/materials/ShaderMaterial.js b/src/materials/ShaderMaterial.js index 5e187448533f6a..826f4d9cdb40ee 100644 --- a/src/materials/ShaderMaterial.js +++ b/src/materials/ShaderMaterial.js @@ -270,6 +270,7 @@ class ShaderMaterial extends Material { this.wireframe = source.wireframe; this.wireframeLinewidth = source.wireframeLinewidth; + this.linewidth = source.linewidth; this.fog = source.fog; this.lights = source.lights; @@ -279,6 +280,14 @@ class ShaderMaterial extends Material { this.glslVersion = source.glslVersion; + this.forceSinglePass = source.forceSinglePass; + + this.defaultAttributeValues = Object.assign( {}, source.defaultAttributeValues ); + + this.index0AttributeName = source.index0AttributeName; + + this.uniformsNeedUpdate = source.uniformsNeedUpdate; + return this; } From ec9bfee4db71cbabd52a726f1c5915e4ac4c6ff5 Mon Sep 17 00:00:00 2001 From: Gourav NSS Date: Sat, 8 Nov 2025 15:50:17 +0530 Subject: [PATCH 2/2] Remove redundant property copies already handled by Material.copy() --- src/materials/ShaderMaterial.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/materials/ShaderMaterial.js b/src/materials/ShaderMaterial.js index 826f4d9cdb40ee..776998d6b47c53 100644 --- a/src/materials/ShaderMaterial.js +++ b/src/materials/ShaderMaterial.js @@ -270,7 +270,6 @@ class ShaderMaterial extends Material { this.wireframe = source.wireframe; this.wireframeLinewidth = source.wireframeLinewidth; - this.linewidth = source.linewidth; this.fog = source.fog; this.lights = source.lights; @@ -280,8 +279,6 @@ class ShaderMaterial extends Material { this.glslVersion = source.glslVersion; - this.forceSinglePass = source.forceSinglePass; - this.defaultAttributeValues = Object.assign( {}, source.defaultAttributeValues ); this.index0AttributeName = source.index0AttributeName;