Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShadowGenerator: add doNotSerialize #16105

Merged
merged 3 commits into from
Jan 24, 2025
Merged

ShadowGenerator: add doNotSerialize #16105

merged 3 commits into from
Jan 24, 2025

Conversation

kzhsw
Copy link
Contributor

@kzhsw kzhsw commented Jan 24, 2025

This PR adds doNotSerialize to ShadowGenerator and IShadowGenerator (optional field for IShadowGenerator to avoid being breaking).
Also, in ShadowGeneratorSceneComponent serialization of a ShadowGenerator would be skipped if it has doNotSerialize=true, or its light has doNotSerialize=true.
This should fix https://forum.babylonjs.com/t/shadowgenerators-serialized-without-light/56134.

kzhsw added 3 commits January 24, 2025 10:16
The value of this field should be used in ShadowGeneratorSceneComponent.serialize method.
Part of <https://forum.babylonjs.com/t/shadowgenerators-serialized-without-light/56134>
ShadowGeneratorSceneComponent.serialize uses `light.getShadowGenerators()` which return value is `Nullable<Map<Nullable<Camera>, IShadowGenerator>>`, so doNotSerialize is needed here.
It's marked as optional field to avoid breaking changes.
This commit should skip shadowGenerator serialization if its light has `doNotSerialize=true` , or itself has `doNotSerialize=true`.

This fixes <https://forum.babylonjs.com/t/shadowgenerators-serialized-without-light/56134>.
@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

@sebavan sebavan merged commit 3b973d3 into BabylonJS:master Jan 24, 2025
14 checks passed
@kzhsw kzhsw deleted the patch-1 branch January 26, 2025 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants