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

Fix Shadow Mapping bug in MiniEngine for Non-legacy renderer #891

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

logancho
Copy link

In the current state of MiniEngine, for arbitrary .glTF models that use the non-legacy rendering path, shadow mapping is broken. The issue was caused by an incorrect orthogonal frustum being calculated for Shadow Cameras, in ../Frustum.cpp. This resulted in the Shadow Buffer containing little to no information due to frustum-culling of meshes with the incorrect frustum.

This patch fixes that bug, allowing for correct shadow mapping for .glTF file rendering in the non-legacy rendering path of MiniEngine!

@logancho
Copy link
Author

@microsoft-github-policy-service agree

@logancho
Copy link
Author

Before the patch, Sponza2.glTF:

Screenshot 2024-11-11 200259

After the patch:

Screenshot 2024-11-11 200954

@stanard
Copy link
Member

stanard commented Nov 19, 2024

Sorry I'm just getting around to this, and it reminded me of a bug someone fixed locally in one of our development branches. I just forwarded the bug fix to this repo's master branch. It affected Frustum.cpp. Can you try stashing your Frustum.cpp change, merge our latest, and see if your sun shadows are working correctly? They seem to work for me with the non-legacy renderer.

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.

2 participants