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

Ensure Voxelizer SDF generation uses the correct cell level #101631

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

Syntaxxor
Copy link
Contributor

@Syntaxxor Syntaxxor commented Jan 16, 2025

For a while, there have been strange shadows in VoxelGI lighting. Recently, through testing, I identified that it was essentially placing two copies of the scene in the SDF, one at full scale and one at half scale. Some digging revealed that the SDF texture generator in Voxelizer was placing both the lowest (highest cell count) and second-lowest octree levels in the SDF. By changing it to only consider the lowest level, the issue is resolved!

Before:
Screenshot_20250116_001702

After:
Screenshot_20250116_001635

Screenshots taken with the VoxelGI Lighting visualization.

Fixes #84992
Fixes #90976
Fixes #38020

First main engine pull request, so please treat me kindly!

@Syntaxxor Syntaxxor requested a review from a team as a code owner January 16, 2025 08:37
@AThousandShips AThousandShips added bug topic:rendering topic:3d cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Jan 16, 2025
@AThousandShips AThousandShips added this to the 4.4 milestone Jan 16, 2025
@Syntaxxor Syntaxxor requested review from a team as code owners January 16, 2025 21:07
@Syntaxxor Syntaxxor force-pushed the voxel-gi-shadow-fix branch from bc14f10 to 393a13a Compare January 16, 2025 21:27
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me. I am not very familiar with this code, but it seems we store levels 0-cell_subdiv (inclusive). So the level we want here is cell_subdiv, not (cell_subdiv-1) as that will be our bottom level.

@Repiteo Repiteo merged commit a0633ff into godotengine:master Jan 20, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jan 20, 2025

Thanks! Congratulations on your first merged contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release topic:rendering topic:3d
Projects
None yet
4 participants