I have an existing application that renders 3D voxel densities (D) and an overlay of 3D voxel labels (L). Those are saved in two pretty large THREE.Data3DTextures
.
I want to use render-to-texture to manipulate a limited area of the 3D voxel labels. I understand, that I cannot use the Data3DTexture
as a render target, but that I need to create a new THREE.WebGL3DRenderTarget()
that will create its own texture/buffer.
I can think of two strategies:
- Create a small 16x16x16
WebGL3DRenderTarget
patch and render to it using D and L as input to the shader. Then copy the result/patch to the right position in the L texture.
Problem: copyTextureToTexture3D()
does not take a RenderTarget
as source and copyFramebufferToTexture3D()
does not exist in THREE.
- Create a
WebGL3DRenderTarget
for L in the first place and render directly to it.
How do I set the initial data of theWebGL3DRenderTarget
? There is not way to provide the data like in the constructor ofData3DTexture()
. Should I use a copy shader?
Problem: the application is already at its memory limit and I do not want to duplicate the L texture.
Since my first attempts failed – I wonder what is the right strategy to approach this?