Thoughts on graphics programming, landscape visualization, open source, and participative planning.
blog
Rendering to Textures: Shadows, Cubemaps, and Special Effects
When we use a camera in a game, it’s usually to choose what the player sees and send it to the monitor. As explained in Introduction to Shaders, the GPU gets the current frame data from the CPU, processes it, and sends the final pixels to its video outputs (or to the operating system - this is essentially the difference between “Fullscreen” and “Windowed Fullscreen”). But that’s not the only thing you can do with a camera: you can also make it render to a texture and use that texture in a material or shader....
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....
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....
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....
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....
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....