question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple Lights Not Working Shadow Map Atlas - Browser / HTML5

See original GitHub issue

Thank you for contributing to Armory!

Description Shadow Map Atlas is not working with multiple lights when targeting HTML5. Under those conditions shadows will break when rendering

image

To Reproduce Add multiple lights to the scene and some objects, select Runtime -> Browser, enable Shadow Map Atlasing under Armory Render Path -> Shadows, play.

Expected behavior image

System Blender: 2.83.10 Armory: latest commit OS: Ubuntu 20.04.2 LTS Graphics card: AMD RX 480 (mesa drivers)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

4reactions
N8n5hcommented, Feb 25, 2021

The changes I pushed for armory and iron should solve the issue with sun, with browser (at least by circumventing it with the way you found with the “double inversion”) and remove the need of the inversion of the shader to save some gpu cycles, please test it out and tell me if I can open a PR @Naxela 👍

Edit: I pushed another commit to iron to support sun with 1 cascade too.

3reactions
N8n5hcommented, Mar 1, 2021

Hi, I tested it and it seems to work for Browser now, but it seems to break on Krom (Windows):

Oops, yeah I forgot to check and add for DirectX too 😅 …

I managed to get it working by adding the direct3d11 for the flip y condition along with HTML5 (write_data.py):

https://gist.github.com/Naxela/361a35b3f604114c729ee756ba8db6fd#file-write_data-py-L537

As well as conditioning out HLSL in shadows.glsl:

https://gist.github.com/Naxela/e2544dbea31cc784ea143c8860e47c5a#file-shadows-glsl-L49

Nice! If you don’t mind I will copy what you did and push another commit and open a PR.

I hope it doesn’t break anything on Linux?:

I’ve checked and HTML5 and Krom openGL works 👍

I think basic light types should work across all targets now, possibly?

Maybe… AFAIK It’s still untested in MacOS with Metal, Safari (not sure if it’s a supported target though), other non-chromium based browsers, Linux © (which I’ve tried but I get this https://github.com/armory3d/armory/issues/2067 even with the default cube), Windows ©, Android, and others that I’ve possibly forgotten.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bountysource
Multiple Lights Not Working Shadow Map Atlas - Browser / HTML5.
Read more >
Shadow Mapping / Multiple lights : r/opengl - Reddit
I got shadow mapping fully working for one directional light in my scene and now I wanna add other lights that cast shadows....
Read more >
3D lights and shadows - Godot Docs
Check if any object affecting the shadow map has changed. If it did, re-render the light. If neither of the above has happened,...
Read more >
Movable Lights | Unreal Engine 4.27 Documentation
Shadow Map Caching and Performance · Select all of the lights that you want to have cast dynamic shadows in your project's level....
Read more >
"Reduced additional punctual light shadows resolution ...
It seems like you have to lower the High Tier to fit with the Atlas Resolution. I set my Atlas to 4096 and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found