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

LightmapGI: Baking lightmap in medium quality or more generate green invalid probes (low generate black invalid probes) #77169

Closed
Tracked by #56033
jcostello opened this issue May 17, 2023 · 20 comments · Fixed by #82068

Comments

@jcostello
Copy link
Contributor

Godot version

v4.1.dev.custom_build [437041a]

System information

Ubuntu with Nvidia 2060

Issue description

IDK the reason why but in medium quality or bigger, invalid probes are green. They should not be taking into account

Medium Quality

Screenshot from 2023-05-17 15-22-34

Low Quality
Screenshot from 2023-05-17 15-16-32

Steps to reproduce

Use MRP

Bake the lightmap (in medium quality)
Move the mesh in the editor to get the dynamic lighting.
You will get same result as the picture above

Minimal reproduction project

lightmap.zip

@Calinou Calinou changed the title Baking lightmap in medium quality or more generate green invalid probes (low generate black invalid probes) LightmapGI: Baking lightmap in medium quality or more generate green invalid probes (low generate black invalid probes) May 17, 2023
@gongpha
Copy link
Contributor

gongpha commented Jun 1, 2023

I can't reproduce it in 2e273f0, whether the medium, high or ultra quality was used
( Windows 11, NVIDIA GeForce GTX 1650 )
image

@jcostello
Copy link
Contributor Author

jcostello commented Jul 1, 2023

I updated the MRP. The issue still happens. Check it out @gongpha

Lightmap2.zip

Just bake as it its

Screenshot from 2023-07-01 07-02-24

@Calinou
Copy link
Member

Calinou commented Jul 1, 2023

I can't open Lightmap2.zip's main scene in the editor:

  scene/resources/resource_format_text.cpp:283 - res://Level.tscn:276 - Parse Error: 
  Failed loading resource: res://Level.tscn. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_data.cpp:626 - Index p_idx = 1 is out of bounds (edited_scene.size() = 1).
  scene/resources/resource_format_text.cpp:447 - res://Materials/Prototype.tres:3 - ext_resource, invalid UID: uid://e46ya640nfhb - using text path instead: res://Textures/prototype_textures/Light/texture_07.png
  Resource file not found: res://Textures/prototype_textures/Light/texture_07.png.
  scene/resources/resource_format_text.cpp:447 - res://Level.tscn:7 - ext_resource, invalid UID: uid://cb7h7egu8wg3e - using text path instead: res://Level.lmbake
  Cannot open file 'res://Level.lmbake'.
  Failed loading resource: res://Level.lmbake. Make sure resources have been imported by opening the project in the editor at least once.
  scene/resources/resource_format_text.cpp:283 - res://Level.tscn:276 - Parse Error: 
  Failed loading resource: res://Level.tscn. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_data.cpp:626 - Index p_idx = 1 is out of bounds (edited_scene.size() = 1).

I've tried to manually edit Level.tscn so I could open it, but attempting to bake lightmaps results in:

No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake Light' flag is on.

PS: I noticed you have a physical cameral camera attributes .tres in the project, but it's not attached to the LightmapGI node.

@jcostello
Copy link
Contributor Author

@Calinou try now.

I didnt get the

No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake Light' flag is on.

I re-added the camera attributes .tres to the LightmapGI node. I was checking if that was the issue. In another large scene that I have, having the campera attributes to the LightmapGI node make the dynamic object to stop working with the probe

Lightmap2.zip

@Calinou
Copy link
Member

Calinou commented Jul 1, 2023

I can confirm this on 4.0.3.stable and 4.1.rc 4642448 (Linux, GeForce RTX 4090 with NVIDIA 535.54.03):

image

However, on 4.1.rc 4642448, I can't reproduce this even after baking lightmaps 5 times, even if I close and reopen the editor between bakes.

Looks like I found a definitive scenario for reproducing this every time on all versions:

  • Remove the LightmapGIData resource from LightmapGI.
  • Exit the editor, remove level.exr, level.exr.import and Level.lmbake.
  • Reopen the editor.
  • Bake lightmaps.

The issue goes away if you bake lightmaps a second time.

Also, if you move the dynamic object anywhere close to the green probe, it becomes extremely bright and doesn't darken until you move it outside the LightmapGI's bounds entirely (likely due to time-based interpolation):

image

@gongpha
Copy link
Contributor

gongpha commented Jul 1, 2023

weird. I still couldn't reproduce this in both versions (4.0.3 stable and 4.1 4642448) after the 3 retries, even though I've done @Calinou 's instructions.
( Windows 11 x64, Vulkan, NVIDIA GeForce GTX 1650 536.23 )
image

@jcostello
Copy link
Contributor Author

@gongpha Try reading the lightmap node

@gongpha
Copy link
Contributor

gongpha commented Jul 1, 2023

@jcostello here's its properties
image

@jcostello
Copy link
Contributor Author

@gongpha I ment re-adding the LightmapGI (remove and add it again)

@gongpha
Copy link
Contributor

gongpha commented Jul 2, 2023

Tried, doesn't work either

@jcostello
Copy link
Contributor Author

The problem happens, it is a real issue, but IDK the right conditions. Maybe debugging the code?
Could be a Linux issue?

@atirut-w
Copy link
Contributor

Could be a Linux issue?

Invalid probes also appear on Windows, IIRC.

@jcostello
Copy link
Contributor Author

Could be a Linux issue?

Invalid probes also appear on Windows, IIRC.

You've been able to reproduce it?

@atirut-w
Copy link
Contributor

atirut-w commented Jul 14, 2023

I've only been able to replicate it with plane meshes where probes are forced to overlap with geometries. I need someone else to confirm if this is the same problem. Yup.

image

@jcostello
Copy link
Contributor Author

Do you have the exact steps so @gongpha can replicate

@atirut-w
Copy link
Contributor

The only reliable way I know of to cause this issue is to force light probes to overlap with geometries. I can link you the model I used later today.

@jcostello
Copy link
Contributor Author

@atirut-w I did that in my MRP but it doesnt work for @gongpha

@gongpha
Copy link
Contributor

gongpha commented Jul 15, 2023

Finally can replicate this in 4.1.stable after creating a massive giant probe swarm (3240 probes). It's like a kind of randomness.

(the orange wireframes are the hiding cube)
image

image
i_97045961_001.zip

@atirut-w
Copy link
Contributor

atirut-w commented Jul 15, 2023

Here's the model I used in my previous screenshot. It causes invalid probes at 16 subdivisions or higher: https://skfb.ly/oIQGY

@jcostello
Copy link
Contributor Author

#82068 seens to fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants