Godot Shader for Beginners: Lightning Strike Effect using step and smoothstep

In this post we’ll go through the process of making a simple lightning VFX using a shader, from conception to implementation. In the process, we’ll learn about step() and smoothstep, both very important and popular functions to achieve all kinds of effects in shaders, as well as (Signed) Distance Fields, which sound intimidating but are really quite simple. First, let’s think about what kind of effect we want to achieve. A lightning strike mainly consists of a bright, thin line....

November 18, 2024 · 6 min · Karl Bittner

Introduction to Shaders

Overview Shaders are everywhere, but these days you rarely have to write them yourself. Game engines come with a multitude of shaders which do everything from moving objects, scaling and rotating them, to coloring and texturing them, calculating lighting (perhaps using a physically-based rendering approach), and applying post-processing effects like bloom or HDR. But sometimes these built-in features are not enough: perhaps you’re going for a certain lighting aesthetic, want to create a unqiue special effect, or just need to improve the rendering performance....

November 10, 2024 · 18 min · Karl Bittner