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

Vulkan: LightmapGI is culled as soon as its origin is outside the camera frustum #71585

Open
Tracked by #56033
Calinou opened this issue Jan 17, 2023 · 1 comment
Open
Tracked by #56033

Comments

@Calinou
Copy link
Member

Calinou commented Jan 17, 2023

Godot version

4.0.beta13 (could be reproduced as early as 4.0.beta11, likely earlier)

System information

Fedora 37, GeForce RTX 4090 (NVIDIA 525.60.11) / AMD Radeon RX 6900XT (Mesa RADV)

Issue description

LightmapGI is culled as soon as its origin is outside the camera frustum (video courtesy of @adamscott):

Capture.video.du.2022-11-24.20.34.31.webm

This can be reproduced in the 3D global illumination demo as per godotengine/godot-demo-projects#758, but also in https://github.com/Calinou/godot-sponza/tree/4.0-dev.

Steps to reproduce

  • Import a 3D scene with bake mode set to Static Lightmaps.
  • Add a LightmapGI node, select it and click Bake at the top of the 3D editor viewport.
  • Move around the camera. Notice how lightmaps disappear from the mesh once the camera moves/rotates in a way that puts the LightmapGI node's origin outside the camera frustum.

Minimal reproduction project

I can create a more minimal MRP if needed.

@clayjohn
Copy link
Member

clayjohn commented Jan 26, 2024

I can't reproduce this issue using the global illumination demo.

I can reproduce with the MRP from #87604 though

The issue in #87604 appears to be that the lightmap is using the AABB from the probes for culling. So the issue requires that you use difference geometry for baking the lightmap than what is being displayed in the final scene.

A solution is to just disable culling by calling RS::get_singleton()->instance_set_ignore_culling(get_instance(), true); in the LightmapGI node. I need to think about this more to see if that is an appropriate solution though

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

2 participants