View Full Version : Adding pixels values using pixel shader

12-12-2006, 01:32 AM
Dear GPU programmers,

I am new to GPU Programming. Can I add
two textures pixel by pixel and store in a new image using GPU Features(GLSL) features.

I have done it using Fixed Pipeline Functinalities which is trivial.


12-12-2006, 02:09 AM
yes, it's possible, just add a FBO as a render target and your set.

12-12-2006, 04:01 AM
Ok, FBOs make sure no window clipping comes in the way when reading back pixels in the end, but
you don't even need a framebuffer object, just the textures in different texture image units and a color buffer to write to.

Mind that the fixed function pipeline uses texture units (normally 4) where shaders access texture image units. Basically the same thing with a different name, but there are 16 of them in current HW and there is no need to call glEnable/glDisable the texturing for them. The shader programs do that implicitly for the samplers you set.