Welcome to Practical Shader Development. This book is intended to be the gentlest introduction possible to the theory and practice of writing shaders for video games. Shader writing is a very large topic, and I can remember feeling very lost when I was starting out. My hope is that this book will help you avoid that same feeling and allow you to take your first steps into the vast world of shaders and game graphics quickly and confidently.
This book’s guiding philosophy is: “a carpenter doesn’t need to know how to make a wrench.” Similarly, you don’t have to know how to build a rendering engine to be able to use shaders to create beautiful visual effects, especially when you’re just starting out. This book is all about empowering you to experiment, be creative, make cool things, and hopefully have some fun in the process. To that end, this book will not attempt to teach you how to be a graphics programmer or try to give you a systematic math education (although we’ll cover a bit of math along the way). Instead, we’re going to start at the very beginning and talk about how modern games put things on a screen, and then jump straight into writing shaders to make the things we put on screen look the way we want. There will be lots of example code, lots of pictures, and by the end of the book we’ll have gone from the very basics of shader writing to writing shaders that use the same lighting found in some of the most popular games on the market.
If at the end of the book you decide that you’d like to dive deeper into graphics programming, and maybe even write your own rendering engine, or dive into more complicated shader techniques, this book will have provided you with a solid set of fundamentals to prepare you for tackling more complex subject matter.