News for hackers. Stuff that matters.
Re:Interactive Intro to Shaders by Waterluvian on Thursday October 26, 2023 @09:58PM (#38033828)
“their parallel nature makes them memoryless and stateless. This translates to: “You can’t store or share data between pixels or shader executions.””

This kind of constraint is so liberating for me for some reason. It just narrows the space a lot I guess.

I also kind of love not having imports and libraries as that also really simplifies things.

Re:Interactive Intro to Shaders by prox on Friday October 27, 2023 @03:59AM (#38035855)
I might be wrong but there are compute shaders that can retake inputs and well, do more computing on them afaik.
Re:Interactive Intro to Shaders by superMayo on Friday October 27, 2023 @04:38AM (#38036055)
Indeed it's a simplification! You can use buffers to keep information from previous states or share state between pixels (for both fragment and compute shaders). Though it can greatly reduce the performance sometimes. For an intro however, I think it's simpler to assume no memory nor shared state.
Re:Interactive Intro to Shaders by prox on Sunday October 29, 2023 @11:09AM (#38059283)
Ah yes, its good to simplify in the beginning! Cool article in any case!
Re:Interactive Intro to Shaders by nwoli on Friday October 27, 2023 @04:16AM (#38035966)
You can set up shaders to access a shared global texture (and write to it). It’s more expensive and a bit to set up so it’s not totally true, but it’s a good first mental model
Re:Interactive Intro to Shaders by signa11 on Friday October 27, 2023 @05:34AM (#38036402)
> This kind of constraint is so liberating for me for some reason.

if you like this kind of a thing, erlang is a kind of thing you would like :o)