Live data from Hacker News

Shaders: How to draw high fidelity graphics with just x and y coordinates

makingsoftware.com

1–10 of 93 posts

Re: Shaders: How to draw high fidelity graphics with just x and y coordinates

#2
You can do some pretty impressive things: https://shadertoy.com/

I skimmed it but didn't see any mention of "ray marching", which is raytracing done in a shader. GPUs are pretty fast now. You can just do that. However you do have to encode the scene geometry analytically in the shader - if you try to raytrace a big bag of triangles, it's still too slow. There's more info on this and other techniques at https://iquilezles.org/articles/

Re: Shaders: How to draw high fidelity graphics with just x and y coordinates

#6
Shaders technically don't even know their X and Y coordinates by default unless you specifically provide those, just as you can provide other coordinates (such as U and V for surfaces) or other values in general (either varying / input attributes, like fragment coordinates typically are, or uniforms, which are the same for every invocation).

Re: Shaders: How to draw high fidelity graphics with just x and y coordinates

#7

Shaders technically don't even know their X and Y coordinates by default unless you specifically provide those, just as you can provide other coordinates (such as U and V for surfaces) or other values in general (either varying / input attributes, like fragment coordinates typically are, or uniforms, which are the same for every invocation).

>Shaders technically don't even know their X and Y coordinates by default unless you specifically provide those

im kind of a boomer regarding shaders but isnt gl_FragCoord always available?

Re: Shaders: How to draw high fidelity graphics with just x and y coordinates

#9
Does anyone have any resources for learning how to do very beautiful clean technical drawings like this? I have some art skill but not the kind that translates to such clean technical drawings with this nice personality. Would love to be able to make some for my own projects.

Re: Shaders: How to draw high fidelity graphics with just x and y coordinates

#10

Shaders technically don't even know their X and Y coordinates by default unless you specifically provide those, just as you can provide other coordinates (such as U and V for surfaces) or other values in general (either varying / input attributes, like fragment coordinates typically are, or uniforms, which are the same for every invocation).

>Shaders technically don't even know their X and Y coordinates by default unless you specifically provide those im kind of a boomer regarding shaders but isnt gl_FragCoord always available?

Is the article about OpenGL? I see a few mentions of OpenGL in a section about graphics APIs that also mentions at least Vulkan, which doesn't automatically provide fragment coordinates, and WebGPU, which also doesn't. Shaders by default have no concept of fragment coordinates; it's OpenGL the API that introduces them by default.
Post reply on HN