I have a 3d texture of a dataset that the user can explore with arbitrarily positioned slice cuts in several viewports. I want to enable user drawing of regions of interest using a binary brush navigated by the mouse cursor ("freehand painting"). I would like the brush to have 3 dimensions
In terms of data structures there will be two textures: the image itself and the mask drawn by the user. Both are 3d textures.
I have the texture coordinates where I want to draw into, that part is sorted. What is the best way to interactively "edit" a 3d texture?
The way is see it I need to read the area affected by the brush back to the CPU and OR it with the brush and then send it back with texturesubbuffer.
Naturally there will be some overhead in this back and forth, but is there an alternative? Is there a way to manually update the texture (we are talking a 3d section of it, so drawing to it seems tedious).
Ideally I would OR a GPU based brush with the mask texture and then draw to screen. Do I need to look at compute shaders?