Skip to content

Commit a018bde

Browse files
committed
Expand shader manipulation to more object types
Addresses #708
1 parent 676e2ca commit a018bde

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/passes/GeometryPass.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,15 @@ export class GeometryPass extends Pass implements GeometryPassOptions, Selective
339339

340340
private updateMaterial(object: Object3D): void {
341341

342-
if(!(object instanceof Mesh)) {
342+
if(!("material" in object)) {
343343

344344
return;
345345

346346
}
347347

348-
const mesh = object as Mesh;
348+
const materials = (Array.isArray(object.material) ? object.material : [object.material]) as Material[];
349349

350-
for(const material of Array.isArray(mesh.material) ? mesh.material : [mesh.material]) {
350+
for(const material of materials) {
351351

352352
if(this.registeredMaterials.has(material)) {
353353

0 commit comments

Comments
 (0)