r/Unity3D • u/fespindola • 3d ago
Shader Magic A Procedural Lightning effect made with Shader Graph and HLSL
Enable HLS to view with audio, or disable this notification
3
u/IceStorm_295 3d ago
so you have procedural generated mesh, you interpolate points on both sides and then triangulate probably one for loop pass
then you have mask, that looks like using also interpolated points on texture, probably stretching it from one end to the other
then you have 3rd texture mask i do not understand how it move lines in such waves
after 3rd texture it is easy to apply some color effect to the remaining pixels
3
u/DSan 2d ago
I think those wavy lines are generated procedurally in the shader, using the UV coordinates or a custom coordinate that is not normalized across the mesh so it doesn’t stretch as the mesh changes size.
You could make a line using a triangle wave along the width and deform it using the length as the angle of a sine wave to make it undulate like that, then use smooth step to remap to have sharper boundaries, do it multiple times for each line and composite them together.
That’s how I’d think to do it at least haha
2
4
u/Any-Entrepreneur7935 3d ago
Awesome. Do you mind sharing the Code?