Skip to content

Allow lights to change without shader recompilation #16854

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

matanui159
Copy link
Contributor

This is just the groundwork so far, making all the lights share the same uniforms. A lot isn't supported right now, notably:

  • PBR materials
  • area lights (need to figure out if I can have a default for the LTC textures? or maybe I just add them to the "not dynamic" list)
  • all the defines are still added and recompilation occurs, need to reduce that down
  • sort the lights that can be dynamic after the lights that can't (for example a sun light with shadows should always the first light)
  • filter out lights that are both dynamic and too far away (might be seperate PR?)

I don't currently plan to make these dynamic (notably since I assume there won't be many lights with these, and also I feel like it would add too much branching in the shader):

  • Shadows
  • lights with falloff other than FALLOFF_DEFAULT (maybe an option could be added to set the default falloff?)

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 4, 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 Jul 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 4, 2025

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