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

Unhooking Metal shadows from the lighting system #1645

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

colincornaby
Copy link
Contributor

@colincornaby colincornaby commented Dec 24, 2024

The D3D9 shadow system would manipulate lights to properly cast shadows. This change decouples Metal shadows from the lighting system and instead passes the required variables directly to the shadow renderer. This allows Metal to avoid expensive light changes to render shadows.

Also includes a fix for high shadow strength causing shadows to be too dark. The Metal pipeline was not clamping the output diffuse color into a valid range.

These changes are to support #1551 by preventing shadows from needing to touch the cache states for the lighting system. But these changes can be merged and reviewed independently.

Copy link
Member

@Hoikas Hoikas left a comment

Choose a reason for hiding this comment

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

Looks fine to me

@colincornaby
Copy link
Contributor Author

@dpogue - It looks like Linux builds are failing. Is that expected right now?

@dpogue
Copy link
Member

dpogue commented Dec 30, 2024

@dpogue - It looks like Linux builds are failing. Is that expected right now?

Ugh, yeah... The newer Ubuntu 24.04 runners don't have mono or NuGet installed 😒

@Hoikas
Copy link
Member

Hoikas commented Dec 31, 2024

The linux CI is not a blocker here, IMO

@colincornaby colincornaby force-pushed the unhook-shadows-from-lighting branch 2 times, most recently from 0130213 to 13668d9 Compare January 1, 2025 22:43
colincornaby and others added 2 commits January 1, 2025 14:48
The D3D9 shadow system would manipulate lights to properly cast shadows. This change decouples Metal shadows from the lighting system and instead passes the required variables directly to the shadow renderer. This allows Metal to avoid expensive light changes to require shadows.

Also includes a fix for high shadow strength causing shadows to be too dark. The Metal pipeline was not clamping the output diffuse color into a valid range.
@colincornaby colincornaby force-pushed the unhook-shadows-from-lighting branch from 13668d9 to 7ed39a1 Compare January 1, 2025 22:48
@Hoikas Hoikas merged commit cb1ef28 into H-uru:master Jan 2, 2025
17 checks passed
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