News for hackers. Stuff that matters.
Re:The Book of Shaders (2015) by amelius on Saturday July 16, 2022 @05:48PM (#32122287)
> In shader-land we don’t have too many resources for debugging besides assigning strong colors to variables and trying to make sense of them. You will discover that sometimes coding in GLSL is very similar to putting ships inside bottles. Is equally hard, beautiful and gratifying.

Really? Is there no emulation environment? This DX (development experience) seems ripe for disruption.

Re:The Book of Shaders (2015) by kevingadd on Saturday July 16, 2022 @05:53PM (#32122319)
Step-through shader debugging has been available since DirectX 9 or earlier. Microsoft shipped a debugger called PIX and a reference shader rasterizer that PIX would use to generate a reference image and let you step through how the shader should behave. I used it extensively.

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...)

Re:The Book of Shaders (2015) by pjmlp on Sunday July 17, 2022 @02:50AM (#32124981)
Unfortunately in what concerns the 3D Web, hardly anything changed.

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.

Re:The Book of Shaders (2015) by djmips on Sunday July 17, 2022 @03:38AM (#32125133)
Although I have not done this myself, I feel like I would be able to get RenderDoc working in a web environment. RenderDoc has good support for OGL. Maybe there's a big barrier in the way but it would be surmountable - just not sure how long it would take.