From 9d8ae6bd71c0a67e8f7f4f0d9fd92f66b436f6e3 Mon Sep 17 00:00:00 2001 From: Codeboy Date: Sun, 18 Aug 2024 21:15:50 +0800 Subject: [PATCH] Fix: depthCompare DepthCompare cant work properly --- src/materials/Material.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/materials/Material.ts b/src/materials/Material.ts index 3247f765..9c57ddf2 100644 --- a/src/materials/Material.ts +++ b/src/materials/Material.ts @@ -96,6 +96,11 @@ export class Material { public set depthCompare(value: GPUCompareFunction) { this._defaultSubShader.depthCompare = value; + for (let item of this._shader.passShader.values()) { + for (let s of item) { + s.depthCompare = value; + } + } } @@ -137,7 +142,7 @@ export class Material { this._defaultSubShader.setDefine("USE_BILLBOARD", value); } - public get topology(){ + public get topology() { return this._defaultSubShader.topology; }