Efficient pixel shader sum of all pixels

后端 未结 3 422
一生所求
一生所求 2021-01-05 04:33

How can I efficiently calculate the sum of all pixels in an image, by using a HSLS pixel shader? I\'m interested in Pixel Shader 2.0, that I could invoke as a WPF shader eff

3条回答
  •  走了就别回头了
    2021-01-05 04:50

    Effects in WPF are much more suited to producing visual result. It sounds like you want to use them for a different type of calculation, to do this you would need to treat the image result as data this would need RenderTargetBitmap which would be done in software anyway. You might want to look at these projects designed for GPGPU.

    Accelerator

    Brahma

    OpenTK I dont know the state of the OpenCL bindings in OpenTK. Other technologies such as DirectCompute and CUDA might be worth a look too.

提交回复
热议问题