https://github.com/nullsoftware/unitylightning
A 3D lightning experimental shader for Unity URP
https://github.com/nullsoftware/unitylightning
game-development gamedev lightning raymarching shader shaders unity unity3d urp
Last synced: about 2 months ago
JSON representation
A 3D lightning experimental shader for Unity URP
- Host: GitHub
- URL: https://github.com/nullsoftware/unitylightning
- Owner: nullsoftware
- License: mit
- Created: 2025-06-01T03:13:13.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-01T08:22:25.000Z (about 1 year ago)
- Last Synced: 2025-07-05T08:40:47.971Z (11 months ago)
- Topics: game-development, gamedev, lightning, raymarching, shader, shaders, unity, unity3d, urp
- Language: C#
- Homepage:
- Size: 33.3 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unity URP 3D Lightning shader
Lightning shader for Unity URP, single bolt with 3D noise
Renders a single animated lightning bolt with glow effect, defined by start and end positions
The bolt itself rendered using ray marching algorithm
Demo:

Shader params:
* **Bolt Color** (Color) - main color of lightning
* **Start Position** (Vector) - start position of the lightning bolt
* **End Position** (Vector) - end position of the lightning bolt
* **Animation Progress** (0-1) (Float) - the "progress" of the lightning bolt.
* **Bolt Radius** (Float) - radius of lightning bolt
* **Glow Radius** (Float) - radius of lightning glowing effect
* **Glow Intensity** (Float) - lightning glow intensity
* **Noise Scale** (Float) - noise scale of horizontal lightning 3d displacment. Works best with `0.5` value.
* **Noise Offset** (Float) - noice offset, accepts any value.
* **Noise Amplitude** (Float) - defines how much lightning should be displaced. `0` value will just show straight line.

**WARNING**: Since this shader uses a ray marching algorithm, I do not recommend to use it in real projects due to performance limitations.