Make scene / Sprite2D always full-bright (Editor helper)

Godot Version

v4.2.1.stable.mono.official [b09f793f5]


I have a bunch of small nodes that aren’t meant to be seen in game, but have a Sprite2D attached to them to make it easy to work with in the actual editor. As far as I can tell, there’s no native way to make a sprite disappear when the game is actually running outside the editor, so I just opted to hide it in the _Ready function, but now I’m facing another problem. In certain areas of my maps, the map is naturally darker, which makes these engine-helper sprites appear dark and hard to see too. Is there a way that works across the board, that would make these sprites always full-bright, in front of everything else, and always ignore the Light2D nodes? I played around with Light Mask but it didn’t exactly give me the results I was expecting, as it would instead always make the sprite full-dark instead.

Your issue is most likely with the CanvasModulate that makes things dark before lighting is done, rather than the lights themselves. It looks like CanvasModulate doesn’t have a setting to only apply to certain light mask layers so to avoid the special sprites being darkened you can add them into another canvas layer

I was able to do it like this pretty easily by using a RemoteTransform2D to keep the sprite moving with the parent
It’s probably best to remove the RemoteTransform and the canvas layer entirely when it’s added in game but just hiding it probably fixes most of the overhead

You could also put this setup into a scene and just instance it inside nodes that needed the special sprite on them, and it could remove itself on _ready or _init so that you don’t have to touch the game object itself other than adding the scene in

1 Like

Thank you! This actually did work, I’ll try to rework it a little later on so I can toggle them when needed, but for now this works!

Another option is to set a CanvasItemMaterial to the sprites you want to always show and set its CanvasItemMaterial.light_mode to Unshaded


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.