Archived

This topic is now archived and is closed to further replies.

"sum all pixels" shader

This topic is 4941 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi... How can i sum all pixels of a texture with a shader? The Texture is really small (16x16 or 32x32) for every side of an cube map, and it will contain float values. One could try to to manually create mipmaps, cos mipmap creation is not supportet for float tex`s, right?. Maybe i could use a global variable? But how can i read this value back? tnx, gsus

Share this post


Link to post
Share on other sites
There is no way to get the value back in a "variable". You can
render to an image or use NVidia''s pixel data range to get it
into a vertex array. But its simply a loop, as the previous poster has pointed out. This means that your hardware needs
to have the state of the art pixel shader 3.0 support. The final
answer has to be written into the resulting image. Basically, all you have to do is to run the pixel shader while rendering
one pixel with texture mapping enabled and correct texture chosen. The resulting image will have the summed color. This
is ofcourse subject to hardware limitations.

SporadicFire.

Share this post


Link to post
Share on other sites