https://github.com/josephy5/volumetriclightscattering-unityurp
A volumetric light scattering effect created for Serious Point Games
https://github.com/josephy5/volumetriclightscattering-unityurp
effects image-effect image-effects postprocessing shaderlab shaderlab-language shaderlabs shaders unity unity-3d unity-shader unity-shaders unity-urp unity3d urp vfx volumetric-lighting
Last synced: 4 months ago
JSON representation
A volumetric light scattering effect created for Serious Point Games
- Host: GitHub
- URL: https://github.com/josephy5/volumetriclightscattering-unityurp
- Owner: Josephy5
- Created: 2024-11-27T07:17:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-27T08:07:55.000Z (over 1 year ago)
- Last Synced: 2025-01-26T06:24:55.930Z (over 1 year ago)
- Topics: effects, image-effect, image-effects, postprocessing, shaderlab, shaderlab-language, shaderlabs, shaders, unity, unity-3d, unity-shader, unity-shaders, unity-urp, unity3d, urp, vfx, volumetric-lighting
- Language: ShaderLab
- Homepage:
- Size: 286 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Volumetric Light Scattering / God rays




A Volumetric light scattering effect that is used to replicate the visuals of god rays in Unity. It was created for Unity URP (6000.0.58f1) and for Serious Point Games as part of my studies in shader development.
It could theoretically run on Unity 2022 since its using the same code I used for the effects's render feature and pass within Unity 2022, but it is untested.
This effect only works on one directional light, and does not support point, spot, or multiple directional lights.
***
**Note:** I have previously created a separate volumetric light scattering effect in Unity 2022 for my own personal use. The code I used for that effect is entirely different from the code in this repository.
However, I might reuse some of the light marching or other light scattering related code from this repository to my personal one, as it is better than what I developed earlier for that effect.
___
## Features
- Fully adjustable screen-based ray marched godrays
- Can choose to use Schlick or Henyey Greenstein
- Adjustable downsampling
- Adjustable via Volume Component
## Example[s]

What it looks with the effect on

What it looks without the effect
## Installation
1. Clone repo or download the folder and load it into an unity project.
2. Ensure that under the project settings > graphics > Render Graph, you enable Compatibility Mode on (meaning you have Render Graph Disabled).
3. Add the render feature of the effect to the Universal Renderer Data you are using.
4. [Optional] Create a volume game object and load the effect's volume component in the volume profile to adjust values
5. If needed, you can change the effect's render pass event in its render feature under settings.
## Credits/Assets used
Unity_Volumetric_Rendering by Mr-222 ([GitHub Repo Link](https://github.com/Mr-222/Unity_Volumetric_Rendering/tree/main)), Used for some of the shader code. Licensed under Unlicense license - See [THIRD PARTY LICENSES](THIRD_PARTY_LICENSES) for details.
"Mossy/Grassy Landscape" (https://skfb.ly/6RYvL) by Šimon Ustal is licensed under Creative
Commons Attribution (http://creativecommons.org/licenses/by/4.0/). No changes made.
(The mountain landscape that you see in the screenshots for demonstration purposes)