Dark Bit Factory & Gravity
PROGRAMMING => General coding questions => Topic started by: spathi on August 26, 2013
-
Gents,
How difficult would it be to write a shader that does simple per-pixel coloring operations based on previous colors of that pixel?
Is that one of the things that borders on impossible for shaders to do? Can pixels keep track of their states?
-
The pixel shader knows nothing of previous state as you mention.... but you can save that state into a texture, and read from the texture in the next frame.
For example:
http://glsl.heroku.com/e#424.12
-
Thank you, kind sir.
Do you have any further information on doing shader operations on video?
-
You could probably achieve some results with alpha blending.
-
Thank you, kind sir.
Do you have any further information on doing shader operations on video?
Shadertoy (http://www.shadertoy.com) supports video processing, so it's certainly possible. There are quite a few examples on there of a Brittney Spears video with various post processing effects. It's not something I've ever tried personally, but I can certainly see that it would be pretty fun to play with :)