Hello everyone,
I’m working on a night-time effect in my game, where a shadow overlay darkens the scene to simulate nightfall. This overlay is implemented using a Sprite Renderer with a semi-transparent custom material. Everything works as intended, except for one issue: I want the moon in my game’s background to remain unaffected by this shadow overlay, retaining its original color and brightness.
I attempted to solve this by adjusting the sorting order, but this solution is not ideal. When I bring the moon to the front, it unrealistically appears in front of mountains and trees.
Is there a way to keep the moon in the background while ensuring it is not affected by the shadow overlay? Any suggestions or shader techniques that could achieve this effect would be greatly appreciated.