Adding pixels values using pixel shader

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.


yes, it’s possible, just add a FBO as a render target and your set.

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.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.