Skip to content

Ensure sky orientation is set when reflection uses sky #107858

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

Merged

Conversation

Mingxi-Z
Copy link
Contributor

In the Forward+ and Mobile rendering backends, sky reflections were missing when the environment was configured with:

  • Background mode set to Clear Color or Color.
  • Ambient Light source set to Background.

This was caused by the sky orientation transform (radiance_inverse_xform) not being set in this specific configuration, even though the USE_REFLECTION_CUBEMAP flag was correctly enabled.

This change decouples the sky orientation logic from the ambient light setup. The radiance_inverse_xform is now updated whenever either the ambient or reflection cubemap is in use.

Fixes: #98487

@Mingxi-Z Mingxi-Z requested a review from a team as a code owner June 22, 2025 15:58
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.

Great work!

@clayjohn clayjohn added this to the 4.5 milestone Jun 22, 2025
@akien-mga akien-mga changed the title Fix: Ensure sky orientation is set when reflection uses sky Ensure sky orientation is set when reflection uses sky Jun 22, 2025
@akien-mga akien-mga merged commit 242b8ff into godotengine:master Jun 22, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@patwork
Copy link
Contributor

patwork commented Jun 23, 2025

Great 👍

Will this affect PR #77810 and ISSUE #53817 also?

@clayjohn
Copy link
Member

Will this affect PR #77810 and ISSUE #53817 also?

No, its a different issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Forward+/Mobile: Missing sky cube reflections in shaders with specific Environment settings
4 participants