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

Baked lights will still cast realtime shadows on non-static objects #93778

Closed
Micharneau opened this issue Jun 30, 2024 · 2 comments
Closed

Baked lights will still cast realtime shadows on non-static objects #93778

Micharneau opened this issue Jun 30, 2024 · 2 comments

Comments

@Micharneau
Copy link

Micharneau commented Jun 30, 2024

Tested versions

  • Reproducible in: v4.2.stable.mono.official [46dc277]

System information

Godot v4.2.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 32.0.15.5599) - AMD Ryzen 7 2700X Eight-Core Processor (16 Threads)

Issue description

In a lot of lightweight video games projects, shadows are baked into lightmaps in order to avoid computing them at runtime. This is especially useful for mobile games, where you want to save as much resources as possible in order to improve battery life, among other things.

However, it seems that Godot still computes realtime shadows for non-static objects in the scene, even if the light is marked as static and shadows are baked, which defeats the purpose of baking shadows to begin with.

Steps to reproduce

  1. Create a simple scene with Static geometry, and create UV2 channels on it for LightmapGI to work.
  2. Add a Dynamic object to the scene
  3. Create a LightmapGI node, and hit the Bake Lightmaps button

Minimal reproduction project (MRP)

BakedShadows_MRP.zip

@mrjustaguy
Copy link
Contributor

at one point there was discussion about splitting rendering of dynamic and static shadow maps, so static shadow maps would still cast shadow on objects, but would only render static geometry and do so once, and allow for overlaying dynamic objects on top in a separate render that would only draw dynamic objects, every frame, reducing the computational requirements at the expense of 2x memory usage

@Calinou
Copy link
Member

Calinou commented Jun 30, 2024

Thanks for the report! Consolidating in godotengine/godot-proposals#8040.

@Calinou Calinou closed this as completed Jun 30, 2024
@Calinou Calinou added archived and removed bug labels Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants