How can I replicate this lighting effect in my game?

Godot Version

v4.7.2.stable.official [ed1daf0bf]

Question

I’m working on a castle area in my game and I made a mockup that looks like this:

Basically the light around the torches is 2 layers of dithered gradient + palette swapping, which is trivial to do in Aseprite but I have no idea how to replicate this in Godot. On top of that, my background tiles already use a palette shader and are basically palette-swapped versions of foreground tiles, so I’m not sure if my idea is even going to work.

So like… how do I even begin to approach that? I found a dithered light shader on godotshaders but it works with custom light nodes, not my weird palette-swapping-masking approach. I originally assumed I would need a dithered cutout in the palette shader so that it would retain the original colors but I have no idea if that’s even possible.

You can dither any gradient in the shader.

Gee thanks, how very helpful.

Anyway I’m kinda trying to create my own dithering shader now that would turn a gradient texture into, well, a more dithered gradient, but I have no idea how to approach this because I’m an absolute noob at math and so I basically tried to borrow some elements from other dithering shaders but obviously it doesn’t work because I don’t know how to string them together :melting_face:

Use bayer8() function from the example you posted and step the gradient against the value it returns for a pixel.