β’ Stylized pixel art lighting via color replacement.
It keeps the original colors of the palette and can create unusual stylization effects.
β’ Web Demo https://nulltale.itch.io/dungeon-tale
β’ Tested with Unity 2021, 2022, uses Urp 2D Renderer and Shader Graph.
Pattern shading Oil6
Sharp gradient shading Fantasy 24
In shadow visible objects Lospec500
In shadow outline FUZZYFOUR
The general idea is to make each color have its own shading gradient defined manually
like it is done in most pixel art palettes.
The shader does this using a set of Lut tables generated from gradient ramps.
The color for replacement is taken from the tables depending on the brightness from the lighting texture.
Colors from the tables can be taken with interpolation blending, to make smooth transitions.
By specify color ramps and using material options, effects as in the examples can be achieved.
Install via Unity PackageManager
https://github.com/NullTale/LutLight2D.git
Bu default the Shader uses the lighting texture from the
Urp 2D Renderer
soUrp Asset
must be configured.
First needed to create the LutLight2D Asset
, it will generate a texture with a set of lut tables for the material.
It will create a material and Grayscale Ramps for it, which should already be enough to apply the material.
Next step is to set the gradient table for each color from the palette.
After the gradients are set, need to press the Bake button to apply the result if it was not done automatically.
Result with the character sprite in the lospec500 palette.
The Ramps file is a common .png which contains shading gradient for each color from the palette, starting from the original, lightest, to the darkest.
Colors also can have alpha channel.
Now the character shaded with black color from the palette, and his light areas like eyes and face are visible in the shadows.
By changing the Color Ramps, unusual materials can be made that are only visible in shadow or light, as in the example for the lospec500 palette.
Examples with other applications can be found in the package samples.
The name Pixel Art lighting is chosen for clickbait and to get search engine traffic.
In general the system and approach itself is something more, it is an artistic lighting with dynamic gradients through color replacement that can be used much more flexibly in both 2D and 3D to express artistic practices in real time.
Though simplified and developed in the direction of PixelArt, the Asset itself is inspired by materials on working with color from painting and applied to artistic purposes.
β’ Below is a semi-entertaining video about choosing colors using gradients and different ways of transitioning through the color wheel, one of which was inspired by this approuch.
β’ Math video about Phong Lighting in contrast with previous one, basically, not very good linear gradient from white to black that was applied as multiplyer over the main image. (common approuch in lighting)
Unfinished, NOT Documentated
from Zacholade to preview changes in the editor
(originally was added in to the description but later removed because of it's state (that was allowed by it's autor!!))
people who are not indifferent, please give him Issues to stimulate a development