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

Full support for arbitrary spotlight scales #2442

Merged
merged 2 commits into from
Feb 28, 2022

Conversation

MoritzBrueckner
Copy link
Collaborator

Fixes #2145 and requires armory3d/iron#155.

Previously the code expected spotlights to be scaled to 1,1,1 and if this wasn't the case, it could happen that spot lights weren't rendered (because each fragment was treated as being outside of the light cone).

Now Armory supports arbitrary spotlight scales, so it is now possible for example to create an elliptic spotlight by scaling it on one axis. The output shape is exactly the same as in Eevee. Unfortunately we need slightly more data on the GPU now (up to 4 more floats per spotlight depending on the shader), but I think that's acceptable.

I put the spotlight glsl code in a new module because it is also used in mobile deferred where including light.glsl would lead to a redefinition of uniforms.

@MoritzBrueckner MoritzBrueckner added the Release Notes: Fixes A pull request that fixes something. Used to generate release notes. label Feb 27, 2022
@luboslenco luboslenco merged commit 6d833aa into armory3d:master Feb 28, 2022
@MoritzBrueckner MoritzBrueckner deleted the spotlight-scale branch February 28, 2022 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes: Fixes A pull request that fixes something. Used to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shadow Map Atlasing: Spot lights don't render when object scale is too high
2 participants