Can someone recommend an ebook with some fun shaders? I’m still learning the concepts. Maybe Gaussian blur or grayscale filters. Not interested in 3D yet.
46
Can someone recommend an ebook with some fun shaders? I’m still learning the concepts. Maybe Gaussian blur or grayscale filters. Not interested in 3D yet.
8 comments
log in to comment.
a bit of a redundant answer but the incomplete Book of Shaders is one I love, not that I know much about shaders, but its a good starting resource, though it sounds like it maaay be too basic for u.
Oh yeah! I started reading this the other day.
thought I was on !spotthesniper@lemmy.blahaj.zone for a moment
I was disappointed at first because that sounds awesome, but your link didn’t work. Then I spotted the spelling mistake.
Oops, fixed that
[deleted]
Nice, thanks!
3D doesn’t make shaders much more difficult. Doing things outside of per-pixel-math, does.
Practically this means a blur is extremly hard to pull off, while grayscale is super easy, and a 3D noise, for example, is only marginally more difficult.
I can recommend Shadertoy as a good motivator, once you finished the book of shaders and want to start strech your legs a bit.
The Book of Shaders is a good base. What helped me most for 2D in Godot was pairing it with two short pages in the official docs: “Your first 2D shader” and the CanvasItem shader reference (it lists what
COLOR,UV,TEXTUREandSCREEN_UVmean in Godot, which most general shader books don’t cover).Your two examples are nice first exercises:
Grayscale, as a material on any Sprite2D or TextureRect:
Blur of everything behind a ColorRect (handy for pause menus):
The second one reads mipmaps of the screen, so it is cheap but a bit blocky at high values. A proper Gaussian blur samples neighbours in two passes, which is a good next step once these make sense.
Reading small, complete shaders also helped me more than long chapters. godotshaders.com has a lot of 2D ones. Disclosure: I make a small 2D shader pack for Godot 4, and the free Lite version has two effects with commented source if you want more examples to pick apart: …itch.io/shader-pack-lite-for-godot-4