Skip to content

A fake volumetric light shader effect for Serious Point Games

Notifications You must be signed in to change notification settings

Josephy5/FakeVolumetricLight-Unity

Repository files navigation

image

Fake Volumetric Light Shader

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

A simple fake volumetric light shader effect. It was created for Serious Point Games as part of my studies in shader development. It was created for Unity 6 URP (6000.0.27f1) but it can work in other unity versions (like Unity 2022 or Unity 2019) and other pipelines (like Built-In).

This method of using a material shader to fake volumetric lighting is often used to save on computer resources & computational power, to be able to run on lower end devices better, or sometimes it can be due to the designer's artistic direction for the game.

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

Features

  • Be able to add a noise texture to the light, using a custom noise texture or a built-in simple noise texture
  • Replicates the look of a volumetric light, specialized specifically for spot lights
  • The color of the light can be customized

Example[s]

image
The Look of the shader effect in the dark

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

Some of the shadergraph code is based on MrTriPie’s Unity Volumetric Light Shader Graph for LWRP Youtube Video -Youtube Video Link-.

The provided volumetric light shaft mesh is also from MrTriPie's Unity Volumetric Light Shader Graph for LWRP Youtube Video tutorial through its provided download link.