Building a Lightning Shader in Unity Using a Single Material.
by Vicente C.
Published |
27
Share
Technical artist Chintan Vadgama gave us a breakdown of a lightning shader they built in Unity, designed to run entirely from a single material.
Technical artist Chintan Vadgama gave us a breakdown of a parametric lightning shader they recently made in Unity, designed to run multiple variations from a single material.
Chintan uses flipbook textures together with Unity's Texture Sheet Animation module to swap the shader's _MainTex on each particle.

This lets the lightning use different distortion textures without creating a new material for every variation.
This gives the lightning a sharp, snapping movement and avoids that sliding texture look common in energy shaders.

The Particle System passes data into the shader through Vertex Streams, including intensity and color. According to Chintan, this is what lets the same material produce different lightning variations.

The shader also uses a vertical gradient mask called LightningTopToBottom to control the overall shape of the lightning. The bottom stays wider while the top gradually becomes thinner.
Once the distortion is applied, the lower part of the bolt stays more stable while the upper section moves around more freely.

Another important part is the posterization step. Without it, the distortion creates very soft gradients that end up looking more like plasma than actual lightning.

To fix that, Chintan used a Posterize node to break the smooth gradients (the soft transitions between bright and dark areas) into more irregular shapes similar to real lightning.
The final step combines the posterized shape with an HDR color property, pushing the values above 1.0 to trigger bloom on the bolt's edges.

If you want to learn more about Chintan's work, the link will be right below. 

Interested in more?
If you want to go deeper into GPU programming in Unity, our book Mastering Compute Shaders in Unity 6 covers everything from your first Compute Shader to particle effects, mesh deformation, and real-time post-processing. 📘 
Jettelly wishes you success in your professional career! Did you find an error? No worries! Write to us at [email protected], and we'll fix it!

Subscribe to our newsletter to stay up to date with our latest offers

© 2026 Jettelly Inc. All rights reserved. Made with ❤️ in Toronto, Canada