From d16d668b9092e973be338705229b5815d510522e Mon Sep 17 00:00:00 2001 From: zhuxudong Date: Wed, 24 Jul 2024 17:46:09 +0800 Subject: [PATCH] feat: loader add enableTransparentShadow (#2263) --- packages/loader/src/SceneLoader.ts | 3 +++ .../src/resource-deserialize/resources/schema/SceneSchema.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/loader/src/SceneLoader.ts b/packages/loader/src/SceneLoader.ts index 4c393b621a..70c851a8e6 100644 --- a/packages/loader/src/SceneLoader.ts +++ b/packages/loader/src/SceneLoader.ts @@ -106,6 +106,9 @@ class SceneLoader extends Loader { if (shadow.shadowResolution != undefined) scene.shadowResolution = shadow.shadowResolution; if (shadow.shadowDistance != undefined) scene.shadowDistance = shadow.shadowDistance; if (shadow.shadowCascades != undefined) scene.shadowCascades = shadow.shadowCascades; + if (shadow.enableTransparentShadow != undefined) { + scene.enableTransparentShadow = shadow.enableTransparentShadow; + } scene.shadowTwoCascadeSplits = shadow.shadowTwoCascadeSplits ?? scene.shadowTwoCascadeSplits; shadow.shadowFourCascadeSplits && scene.shadowFourCascadeSplits.copyFrom(shadow.shadowFourCascadeSplits); scene.shadowFadeBorder = shadow.shadowFadeBorder ?? scene.shadowFadeBorder; diff --git a/packages/loader/src/resource-deserialize/resources/schema/SceneSchema.ts b/packages/loader/src/resource-deserialize/resources/schema/SceneSchema.ts index b05924225e..3abf8ba98e 100644 --- a/packages/loader/src/resource-deserialize/resources/schema/SceneSchema.ts +++ b/packages/loader/src/resource-deserialize/resources/schema/SceneSchema.ts @@ -39,6 +39,7 @@ export interface IScene extends IHierarchyFile { }; shadow?: { castShadows: boolean; + enableTransparentShadow: boolean; shadowResolution: ShadowResolution; shadowDistance: number; shadowCascades: ShadowCascadesMode;