brainbrowser
brainbrowser copied to clipboard
Color mapping on the GPU?
Not sure about this, but color mapping is one of the more expensive operations in both viewers. Since the operation on each pixel of the intensity data is independent of all others, it seems like it should be possible have the mapping parallelized on the GPU, and if so, I think there would be a significant boost in performance. I think the steps would be:
- Create a 1 X n off-screen canvas that would hold the result.
- Send the intensity data to the context as a 1d texture.
- Render a full screen quad.
- Custom fragment shader will do the mapping.
- Pull the color data from the canvas using
getImageData()
The question is whether the overhead required to set it up will be compensated for by the parallelization.