0 votes

I am simulating a day/night cycle with a CanvasModulate, and it works great. However, I have several overlays (electricity grid, water, etcetera) that should be visible at all times (thus not affected by the CanvasModulate node).

One option is to put the overlays into a seperate CanvasLayer, however, this way the node is fixed to the camera, which I don't want. (I want to be able to fly around the grid with the camera.)

How can I make a CanasModulate exclude certain layers, or should I opt for a different solution for modulating the canvas?

Thanks in advance!

in Engine by (33 points)

How about a fullscreen overlay darkening stuff behind it?

Or, using a specific CanvasItemMaterial for every element affected by the day/night cycle, and change it so every sprite using it will be shaded?

I already tried the overlay, but it doesn't really work the same way, unfortunately. The CanvasModulate works well with lights, while the overlay completely ignores lighting and just makes everything underneath it black/grey :(

Would you happen to know a good tutorial on CanvasItemMaterial? I can't really figure it out from the Docs.

Also, it works to put the grid overlays inside a CanvasLayer, and then simply adjust the offset of that layer (to the camera position) every frame, but I find that to be laggy.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.