A minimal Godot demo project showcasing 2D light masking node with optional dithering/palette effects like in old pixel games. Drop in any gradient or pattern texture, tweak the size, transparency, dither style, and you’re good to go. No heavyweight Light2D
nodes, just fast, flexible, pixel-perfect lighting.
- The project contains a
FauxLight
node you add as a child of anything you want to have a light follow. Make sure to set its z-index to a number higher than the thing you want to mask. - Add a foreground texture, foreground
Parallax2D
, or add aParallax2D
node with a dark overlay and set itsscroll_scale
to(0,0)
. This makes it effectively behave like aCanvasLayer
but without breaking rendering order. - Place a
BackBufferCopy
node before the overlay with the copy mode set to "Viewport" (so it grabs everything on screen under it).
By default, just to keep things snappy, all nodes share the same static shader material, but uses per-instance uniforms for speed, and you can just scale the sprites for different sizes. Feel free to set the shader material to be unique if you want a different pixel size or dithering pattern per light.
This also contains demos of some of my other shaders. Read more here: https://godotshaders.com/shader/arbitrary-color-reduction-ordered-dithering/