←back to thread

109 points Doches | 4 comments | | HN request time: 0.497s | source
Show context
montebicyclelo ◴[] No.45897696[source]
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".
replies(2): >>45897737 #>>45901969 #
1. lukan ◴[] No.45897737[source]
I found them fun once they work, but if something did not work, debugging them I did not enjoy so much.
replies(3): >>45898097 #>>45900586 #>>45906143 #
2. jangxx ◴[] No.45898097[source]
Nothing 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.
3. FormFollowsFunc ◴[] No.45900586[source]
I 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.
4. thegrim33 ◴[] No.45906143[source]
Well 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.