Skip to content

Commit

Permalink
fix: Shadow of double side materials. (#337)
Browse files Browse the repository at this point in the history
Shadow of double side materials.
  • Loading branch information
hellmor committed Nov 21, 2023
1 parent ea2ed66 commit e4004e7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/materials/Material.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ export class Material {
}

public set cullMode(value: GPUCullMode) {
this._defaultSubShader.cullMode = value;
if (this._defaultSubShader.cullMode != value) {
for (let list of this._shader.passShader.values()) {
for (let pass of list) {
pass.cullMode = value;
}
}
this._defaultSubShader.cullMode = value;
}
}

public get depthWriteEnabled(): boolean {
Expand Down

0 comments on commit e4004e7

Please sign in to comment.