- Home /
How to get current color buffer pixel value in shader?
I was wondering how to get the current screen pixel value during rendering in a shader?
I need to clear all pixels alpha to zero, and I was thinking that the best way to do this is to keep the current color, and zero the alpha channel.
Thanks in advance
Answer by adam_dicker · Aug 28, 2013 at 01:06 AM
This did not technically answer the question, so I dont think I should answer with this, though it DID solve my problem:
ColorMask A
and render full screen quad with color.alpha = 0. This wont render to the color channels, but will zero the alpha channel.
This is the only way i know ;) You can't read back the current values in the shader. The shader can use a blend function to use the previous value, but you can't "read" the value.
ps: I've accepted your answer ;)