Dark Bit Factory & Gravity

PROGRAMMING => General coding questions => Topic started by: spathi on August 26, 2013

Title: Pixel Shader Question
Post 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?
Title: Re: Pixel Shader Question
Post by: Voltage on August 26, 2013
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
Title: Re: Pixel Shader Question
Post by: spathi on August 26, 2013
Thank you, kind sir.

Do you have any further information on doing shader operations on video?
Title: Re: Pixel Shader Question
Post by: ryt on January 07, 2014
You could probably achieve some results with alpha blending.
Title: Re: Pixel Shader Question
Post by: Raizor on January 07, 2014
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 :)