Skip to content

wjw12/VolumetricLights

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Volumetric Lights for Unity 5

The original project can be found here. And the following is a brief introduction by the original author:

IMAGE ALT TEXT HERE IMAGE ALT TEXT HERE

Open source (BSD) extension for built-in Unity lights. It uses ray marching in light's volume to compute volumetric fog. This technique is similar to the one used in Killzone (GPU Pro 5: Volumetric Light Effects in Killzone Shadow Fall by Nathan Vos)

Corresponding thread in Unity Forum can be found here.

Multichromatic Light Extension

I added a few lines of code, namely creating new script VolumetricLightProjector.cs and new shader VolumetricProjection.shader so that the light volume can be multichromatic, which resulted in:

The following gif is rendered with the camera lying inside the light volume and the spotlight is rotating along its local axis.

To use this multichromatic light volume, attach VolumetricLightProjector.cs instead of VolumetricLight.cs to the lights that you want to create this effect on. And then add a colored image as light projection texture.

The idea of my algorithm is: When performing raymarching in light's volume, we sample the color from light projection texture. Color are accumulated on the way to achieve the final output color.

About

Volumetric Lights for Unity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 56.0%
  • ShaderLab 44.0%