CanvasModulate exclude layers

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CyttilDalionzo
:warning: Old Version Published before Godot 3 was released.

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!

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?

Zylann | 2016-09-26 20:26

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 :frowning:

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.

CyttilDalionzo | 2016-09-27 15:44