DitherFx
DitherFx copied to clipboard
⬜ Pattern Dithering post effect for Unity Urp
DitherFx
▒░ Dither post effect for Unity Urp, controlled via volume profile ▒░ Works as render feature or a pass for selective post processing VolFx
Features
- custom palettes and patterns
- pattern distribution and animation options
- noise mode
Part of Artwork Project
- Vhs
- OldMovie
- GradientMap
- ScreenOutline
- ImageFlow
- Pixelation
- Ascii
- [Dither]
- ...
Usage
Install via Unity PackageManager
https://github.com/NullTale/DitherFx.git
Works as render feature, some parameters and default volume settings can be configured in the asset.
Tech
The effect works by calculating a deviation for each pixel of the original image from the nearest color, if it is large enough it replaces it with the second closest color from the palette doing it according to the ScreenSpace pattern or random noise.
Dither Power, palette, pattern type and its animation can be customized in VolumeSettings or in RenderFeature settings.
All calculations are performed in the fragment shader through hased Lut tables.
To measure a colors of an original image three lut table are used
- palette color - color replacement from the palette
- deviation color - second closest color from the palette
- and measure - distance to the clossets color, used evaluate dithering power
Tables are generated at Runtime when an unknown palette is used for the first time and shared beetween all features.