6 ms·
As a hobbyist, shaders is up there as one of the most fun types of programming.. Low-level / relatively simple language, often tied to a satisfying visual resul
by montebicyclelo 10mo ago
As a hobbyist, shaders is up there as one of the most fun types of programming.. Low-level / relatively simple language, often tied to a satisfying visual result. Once it clicks, it's a cool paradigm to be working in, e.g. "I am coding from the perspective of a single pixel".
- lukan 10mo agoI found them fun once they work, but if something did not work, debugging them I did not enjoy so much.
- jangxx 10mo agoNothing like outputting specific colors to see what branch the current pixel is currently running through. It's like printf debugging but colorful and with only three floats of output.
- FormFollowsFunc 10mo agoI agree it’s very difficult to debug them. I sometimes rewrite my shaders in Vex and debug them in that. It’s a shader language that runs on the CPU in Houdini. You can output a value at each pixel which is useful for values outside the range of 0 to 1 or you can use printf(). I’m still looking for something that will transpile shaders into JavaScript.
- thegrim33 10mo agoWell in the GL/Vulkan world there's finally functionality now in recent years for printf output from shaders, which finally fixes the issue. I'd assume DirectX probably also has something similar but I don't work with it so I don't know.
- lukan 10mo agoHm .. I just have limited experience with WebGPU so far, but since that is still highly unstable and I really would like a printf functionality and all of the performance possible, I guess I should rather invest all my learning efforts towards Vulkan. Thanks for the hint.
- bathtub365 10mo agoIt’s interesting that this hasn’t been solved for pixel shaders. With HIP in the GPGPU world I’m able to set breakpoints in a GPU kernel and step through line by line. I can also add printf statements to output values to the console.
- 0xf00ff00f 10mo agoYou can do all that with Vulkan and RenderDoc.