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

VoxelGI not showing at runtime. Only manually activating .bake() in code makes it visible. #78569

Closed
Tracked by #55328
idchlife opened this issue Jun 22, 2023 · 4 comments · Fixed by #81124
Closed
Tracked by #55328

Comments

@idchlife
Copy link

idchlife commented Jun 22, 2023

Godot version

4.0.3, 4.1 beta 3

System information

macOS Ventura 13.0

Issue description

As my scene grown complex VoxelGI started showing some weird behaviour.

In editor VoxelGI appears way too bright, and in game - "normal amount".
At first I worked almost 3 weeks on a scene thinking "VoxelGI is just exaggerated in the editor, should keep checking lighting at runtime after scene changes".

To my horror, I noticed something today. Just for the sake of experiment while playing the scene I unchecked and checked VoxelGI node visibility in the editor.
It appears, VoxelGI was not even turned on at runtime (despite the fact that it is visible in editor in local and remote tabs, eye icon is lit). Only unchecking and checking in editor, while game was up, connected to the editor, I learned that I worked on a "usual" lighting without VoxelGI all that time!

No errors in console, nothing. At the moment I have 300+ objects when VoxelGI is baking, it takes approximately 3-4 seconds to bake. Objects of a different size.

Only baking at runtime or checking in editor while game is up - helps.

Video of me baking manually in code at runtime, difference is visible (freeze is the moment of baking at runtime):

https://imgur.com/a/25KSZ4X

This seems like some kind of elusive bug, since there are no errors in the console. I hope someone else would have more information about this behaviour (to confirm it), and at the moment all I can do is bake at runtime.

Workaround:

Place this script on VoxelGI:

extends VoxelGI


# Called when the node enters the scene tree for the first time.
func _ready():
  get_tree().create_timer(2.0).connect(
    "timeout",
    func():
      print("Making GI visible!")
      self.bake()
  )

Steps to reproduce

Unfortunately I cannot give steps to reproduce, since it happens only in my scene and basically you will need to do a lot of different kind of actions to achieve the problematic behaviour.

Minimal reproduction project

Again, I can't give minimal reproduction project. I tried to reproduce it with new scene and CSGBoxes, a lot of them - no luck.

@Calinou
Copy link
Member

Calinou commented Jun 22, 2023

Do you have SDFGI enabled in the Environment? Can you reproduce this on another device not running macOS?

@idchlife
Copy link
Author

Do you have SDFGI enabled in the Environment? Can you reproduce this on another device not running macOS?

SDFGI is not enabled.

I will try to reproduce this on PC on Windows.

@Qionn
Copy link

Qionn commented Jun 28, 2023

I'm experiencing the same problem in my project. Even when switching between scenes in the editor it causes VoxelGI to not show.

Workaround

Toggling the visibility seems to work for my project, and is faster than re-baking the scene at runtime.

extends VoxelGI


func _ready():
	await get_tree().create_timer(2).timeout
	self.visible = false
	self.visible = true

Update

All the lights in my scene had their bake mode set to Static. When I changed the bake mode of every light to Dynamic, the problem fixed itself.

@idchlife
Copy link
Author

idchlife commented Oct 6, 2023

This actually... makes sense! I wonder if it is written anywhere that only dynamic baking should be used when using Voxel GI?..

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.

6 participants