Skip to content

NullTale/DitherFx

Repository files navigation

DitherFx

Twitter Discord Boosty

▒░ Dither post effect for Unity Urp, controlled via volume profile
▒░ Works as render feature or a pass for selective post processing VolFx

_cover _cover

Features

  • custom palettes and patterns
  • pattern distribution ​and animation options
  • noise mode

can be used to process greenscreen video to pixelart sprites at runtime using palette with alpha channel and VolFx

Part of Artwork Project

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.

image

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.
Gradients

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.
Luts