Skip to content

A dither fading effect for objects based on camera distance, created for Serious Point Games

Notifications You must be signed in to change notification settings

Josephy5/DitherFadeEffect-Unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DitherFade

Dither Fading Shader Effect

Unity Version Unity Pipeline Support (Built-In) Unity Pipeline Support (URP) Unity Pipeline Support (HDRP)

A very simple dither fading shader effect that uses dithering to fade in and out based on camera distance. It was created for Serious Point Games as part of my studies in shader development. It is meant to be for Unity 2019 URP (2019.3.35f1) but it can work in other unity versions (like Unity 6 or Unity 2022) and other pipelines (like Built-In). This repo is meant to be a reliable and accessible resource to create the simple dither fading effect.

This is very simple and easy to create from scratch and intergrate to any material shader effect. But if your effect does need to depend on alpha & alpha clipping for other uses, you will need to find a way to blend the dither fading with whatever effect that relies on alpha & alpha clipping. This repo is to provide a reliable and accessible means to create the simple dither fading.

You can refer to the effect's documentation for more info (should be in the repo and its release as a PDF file).

Features

  • Dither fade in or out based on camera distance

Example[s]

DitherFade
The dither fading shader effect in action

Installation

  1. Clone repo or download the folder and load it into an unity project.
  2. Create a new material from the shadergraph, or use the provided one if you want to.
  3. Drag the material onto the mesh object/gameobject that you want to apply the effect on, or go to the object’s inspector panel and change its material to the material with the volumetric spotlight shader.
  4. Optionally, you can use one of the prefabs to have a volumetric spotlight by going to the prefab folder and drag one of them into the scene.

Credits/Assets used

Shader code is based on PabloMakes’ Dither Fade in Unity YouTube video Youtube Video Link.