brainbrowser icon indicating copy to clipboard operation
brainbrowser copied to clipboard

Color mapping on the GPU?

Open tsherif opened this issue 9 years ago • 0 comments

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:

  1. Create a 1 X n off-screen canvas that would hold the result.
  2. Send the intensity data to the context as a 1d texture.
  3. Render a full screen quad.
  4. Custom fragment shader will do the mapping.
  5. 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.

tsherif avatar Sep 23 '14 16:09 tsherif