Chapter 10: Next Steps
Review your accomplishments and consider next steps
Congratulations on making it to the end of the advanced 2D shaders tutorial! We have come an incredibly long way from our starting point. Let us take a moment to look back at everything we've accomplished.
We started by building a robust hot-reloading workflow to make shader development fast and interactive. We then built a Material class and a real-time debug UI to make our shader code safer and easier to work with.
With that foundation, we dove into creating effects. We built:
- A flexible, texture-driven screen transition effect.
- A powerful color-swapping system using a Look-Up Table (LUT).
- A 3D perspective effect by writing our first custom vertex shader.
- A complete 2D lighting and shadow system using advanced techniques like deferred rendering, normal mapping, and the stencil buffer.
You have the tools to develop shaders in MonoGame, and you have implemented a set of effects that bring 2D games to life.
Next Steps
The world of graphics programming is vast and there is always more to learn. If you are excited and want to keep going, here are a few topics to explore.
Advanced Post-Processing
We touched on post-processing with our scene transition, but there are a whole world of effects you can apply to the final rendered image. Effects like bloom, depth of field, chromatic aberration, and film grain can all be implemented as shaders that process the entire screen to give your game a unique stylistic look. Check out the bloom effect in the NeonShooter sample.
Beyond SpriteBatch
In this tutorial, we worked within the confines of the default SpriteBatch vertex format (VertexPositionColorTexture). MonoGame can draw arbitrary vertex buffer data with the GraphicsDevice.DrawPrimitives() functions. You can draw shapes with more than 4 corners. You can pass extra data per vertex, like a unique id, custom data, or whatever you need for your effects. If you want to get into 3D game development, then you will need to expand beyond SpriteBatch.
Continued Reading
This tutorial series was an exploration of various shader topics, with a focus on MonoGame's tooling. As you continue to develop new effects and shaders for your games, you will undoubtedly need to research far and wide on the internet for help. Graphics code can be notoriously hard. Here are a few resources that may help you.
GDC Vault has lots of free videos where game developers showcase their groundbreaking graphics advancements in video games.
HLSL Intrinsic Functions lists out the functions you can use in HLSL.
The Book Of Shaders goes from shader fundamentals to building complicated effects. It has live code editors in the browser so you can tweak the shader and see the result right away!
Shadertoy is an online shader editor with a live preview in the browser. It also functions as a vibrant library of cool effects and techniques you can learn from. Often, if there is a technique you want to learn, some wizard has implemented it on Shadertoy.
Inigo Quilez is a legend in the shader community and has written many fantastic tutorials.
There are a lot of wonderful Youtube videos that cover shaders. Here are just a few.
- Dan Moran makes the Makin' Stuff Look Good In Video Games. This channel has videos examining effects in existing games and recreating them by hand.
- The Art Of Code has several videos writing shaders from scratch with Shadertoy.
- Acerola has great case study videos recreating effects from existing games.
- Freya Holmér has many great videos that delve into mathematics for game developers.
A Final Note From The Author
Hey friend, If you read through this whole series, then thank you for lending me your time and patience. Hopefully you learned some good information, or at least enjoyed the ride. I love shader programming, but it took me a long time to build up any intuition around computer graphics. I hope that you find the spark in graphics programming that leads you to build beautiful things.
Best,