3

I halfway remade a 2d radar in shadertoy (original in description).
https://shadertoy.com/view/wt3SR7/
(watch it in 640x360 by zooming in or out until you get that res, I tried to main aspect ratio, but I hardcoded one value because I'm lazy)

shaders are tough to get started with:
no breakpoints.
logging doesn't make sense so it's avoided.
if's are replaced with step statements.
if you suck at math, you suck at shaders.
if you suck at trig, you suck at shaders.

hardcoding values is viable debugging.
hail hsb2rgb for pretty colors (I have no fucking idea how does it work though).

I tried writing here the challenges I found while making it, but most of them are heuristics and are hard to follow/explain in just text.

I can say though, that sometimes you come up with a solution, but it doesn't look really good, so you have to use something else.

or sometimes you come up with a solution but it also creates unwanted coloring that you have to erase.

or sometimes you have no fucking idea what your operations results are, or you get dizzy by the math. Hardcoding helps wonders.

Comments
  • 1
    Shader debuggers are available from each vendor, though they generally integrate well with visual studio only the last time I checked.

    Also you can use if, but branching is potentially extremely expensive because of the architecture of GPUs.
Add Comment