// HACKER NEWS — CYBERSECURITY
First Shader from Zero in Godot 4
Modern game engines like Godot use many shaders under the hood.
What is a shader? It's a program that runs directly on your computer's graphics card. Shaders control how the GPU draws 3D models, particles, 2D sprites, and more to the screen.
When getting started making games, you don't necessarily have to learn how to program shaders. Godot provides you with many built-in visual effects that you can tweak without writing shader code. Also, the Godot community created many free shaders you can find on Godot Shaders, or in GDQuest's free and open source shader collection. You can copy their code into your game and use them as a starting point.
But to get the exact look you want, have fun creating unique visual effects, or make your game run faster, you eventually need to learn how to code shaders.
For example, when you see a glowing portal in a game, grass moving in the wind, or animated 2D water in a platformer, these effects are powered by shaders.
This detailed beginner's guide will help you get started. It will teach you how to write your very first 2D shader in Godot 4.
You will create an animated portal shader, one step at a time.
This effect will teach you many transferable techniques that you will need for all sorts of 2D and 3D visual effects:
You will also learn how shaders are different from traditional programs and the mindset they require. You will learn how to think like a technical artist by breaking complex visual effects into small, manageable problems. You will also learn how to debug shaders using Godot's great shader visual debugging feature.
This guide is for people who have no experience with shaders or graphics programming. But it focuses on visual effects, so we don't teach basic programming concepts like variables or loops. We assume you already know the basics of GDScript and Godot.