The Book of Shaders (2015)
thebookofshaders.com
thebookofshaders.com
I don't know a good place to recommend to use more common techniques. A few though would be
which includes all the GPU Gems books for free
https://developer.nvidia.com/gpugems/gpugems/contributors
Of course if you enjoy the kinds of techniques Book of Shaders teaches then knock yourself out. I've written a few hundred "puzzle shaders". I just know I'm solving a puzzle which can be super fun and I might learn stuff that's relevant elsewhere but at least I'm fully aware that most of what I'm doing is not really related to how GPUs in the majority of situations.
While surpassed, still has some gems into it.
https://developer.download.nvidia.com/CgTutorial/cg_tutorial...
That said, it’s a great resource for shaders and I can’t wait until it’s complete.
Edit: it’s not consistent: I refreshed the page and it was pretty readable. Sometimes it is so shaky it’s completely illegible
The Book of Shaders - https://news.ycombinator.com/item?id=23497924 - June 2020 (26 comments)
The Book of Shaders - https://news.ycombinator.com/item?id=15599935 - Nov 2017 (37 comments)
The Book of Shaders - https://news.ycombinator.com/item?id=11457322 - April 2016 (15 comments)
The Book of Shaders - https://news.ycombinator.com/item?id=9215582 - March 2015 (40 comments)
Really? Is there no emulation environment? This DX (development experience) seems ripe for disruption.
Reference rasterizers also exist for D3D11 (Windows ships with one called WARP and it's fast enough to actually use for many workloads). I think there might be one for D3D12 as well but I'm not sure.
The dark ages 'printf with colors' stuff they describe is somewhat unique to GLSL and is just a smaller example of how the entire OpenGL ecosystem was horrible for debugging and not well designed. These days people can use Vulkan or D3D11 if they want an ecosystem that was designed intentionally and has good tooling (D3D12 is more comparable to Vulkan but is honestly not worth the trouble for most people yet). For a taste of what good modern graphics debugging looks like, run a modern game in Renderdoc and you can take a snapshot and then pick a random pixel on-screen and step-through debug the shader.
Naturally, game consoles have even better tooling. The PS4 SDK let you step through the actual low level instructions running on the GPU (I'm not sure if they were simulating execution or not though...)
The easiest way is to consider it as a target platform and do everything native during development and deploy to Web as last step.
From the last WebGL + WebGPU meeting, the answer given to the state of GPU debugging, it seems nothing better than SpectorJS is expected in years to come.
A bit sad when browser vendors don't see it as a priority, no wonder Indies rather go mobile native instead, or nowadays streaming, better APIs and tooling out of the box.