Pop-Art Light Shader: Halftone Shading in Godot

Handpainted Light Shader: Cross-Hatching in Godot showed how to use textures in light shaders to apply hand-painted shadows. We can use a similar technique for halftone shading, where shades of darkness are represented by black dots of varying size: This effect reads from a texture and wraps it in a step function to get dots of varying size, much like how we got a line of varying thickness in Godot Shader for Beginners: Lightning Strike Effect using step and smoothstep....

December 13, 2024 · 2 min · Karl Bittner

Handpainted Light Shader: Cross-Hatching in Godot

In Understanding Godot Light Shaders and Light Calculations by Implementing a Toon Light Shader, we discussed light shaders and how you can use functions like step() to switch from realistic to toon lighting. Here, we will use light shaders along with a hand-painted texture to create a cross-hatching effect. Cross-hatching is a (pencil) shading technique that looks like this: Bright areas are left blank, whereas darker areas are shaded with parallel lines....

December 12, 2024 · 4 min · Karl Bittner

Understanding Godot Light Shaders and Light Calculations by Implementing a Toon Light Shader

In Introduction to Shaders, we discussed the two most common shader types: Vertex and Fragment. Godot offers another function to override: the Light shader. In this tutorial, we’ll see what we can do with this shader. To do so, we’ll have to look into how light is generally calculated in real-time 3D environments, how to implement this ourselves, and how to make changes to it to get a toon shader with uniform colors and hard edges....

December 6, 2024 · 8 min · Karl Bittner

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