Hacker News new | past | comments | ask | show | jobs | submit login

Shaders are cool - I think? I wanted to use them for generative animations , but (maybe I have it wrong) I could not see a way to store state with each pixel. I wanted the color of the pixels to be a view onto some underlying state at that pixel location - and update that state in a shader manner, so parallel and multi-threaded, with each state step depending only on the state of its neighbors - a generalized pixel if you will.



Sounds like you need a multi-pass shader. As an example, you can store state in one pass, apply operations in another pass, and render in the last pass.

Example: https://shadergif.com/gifs/324


You can't store state in pixels, just use a texture. The value of a pixel in the texture is your 'pixel state'.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: