I just finished a fun VFX that I’ve been making again with Unity6 and VFX Graph:
Here is the Breakdown:
Scene:
The Scene is minimal and composed of:
- Ground Plane
- Sphere
- 2 VFX Graph
- A C# Script.
C# Manager:
The Script handles the spawns of the lighting Strikes. While this could have been done inside VFX Graph, using a C# script allows us to easily sync up the VFX with the spawn of point lights and SFX.
This allows to control:
- Random areas for lightning strikes.
- VFX Strike Color synced with the spawned lights.
- Random delays between each strike.
Lighting Strike Overal Breakdown:
The Main VFX Graph is composed of 8 systems. Three of them are infinitely looping and bound to the Tesla Sphere. The rest are responsible for the lightning strike and triggered by the C# Manager via a custom event.
Tesla Sphere:
- Sparks particles.
- Glow particle.
- A Smoke particle.
- Some electric arcs
The Electric Arcs are made procedurally using Strip/Trails:
- Spawn randomly on the Sphere’s surface.
- Conform to the Sphere’s shape using forces and sphere collision.
- Jittered thanks to turbulence forces.
- Pushed in the direction of the Sphere’s normals.
Lightning Strike Systems:
Each strike event spawn the following systems:
- Strikes.
- Sub-Strikes at impact position.
- Hit Flash.
- Debris particles.
- Electric Dust/Sparks.
Main Strike:
Each Strike spawns from 3-6 Strip/trails. One is considered the “Main Strike” while the other is secondary. The shapes, Colors, sizes, and values are modulated based on the strike being a Main or Secondary one.
To get the strike shape using Strips, the particle’s positions are blended between the Random Strike position to the closest position on the Sphere.
To amplify the electric and wild behavior, some stroboscopic noise is applied to most emissive values, from the electric dust to the electric strikes, adding that extra zappy feel.
You can get all the steps of Lightnning Strike in this Thread. But to make it shorter, here’s a recipe’s sheet with the different ingredients summarized:
Ambient Smoke:
To get a nice and moody atmosphere, I’ve also added some ambient smoke. On top of setting the mood, some nice interaction can be made between the lightning strikes and the smoke. To this end, I’ve blended some Low-resolution Volumetric fog. This reacts very well with the spawned point lights.
Now, to get more intricate details, this fog is blended with Smoke particles. They’re using a 6-way smoke-lit shader allowing them to respond properly to lighting.
Finally, the Smoke also received the HitPosition from the C# Manager. This way, some custom forces are created upon impact so that the smoke get pushed away from the impact position.
This is done roughly like so:
Direction = Normalize( ParticlesPosition - ImpactPosition) * ForceStrength;
That is it for the breakdown. hope it will useful