Share WebGLRenderTarget across renderers

As documented in #13745 it is not currently possible to use a texture generated by rendering to a WebGLRenderTarget in another renderer. Rendering to the same canvas is fine for the use-case mentioned in that issue, but I would like to generate some complex textures off thread using workers and OffscreenCanvas, then use them as textures in the scene displayed to the user.

Right now it appears that the only way to do this would be something like https://stackoverflow.com/questions/29325906/can-you-use-raw-webgl-textures-with-three-js but it strikes me that this is a legitimate case that might warrant a feature request.

Author: Fantashit

1 thought on “Share WebGLRenderTarget across renderers

  1. If it should work then i will definitely go and build a minimal example to see what I’m doing wrong.

    I’m afraid this won’t work since you can’t share any WebGL resource (e.g. buffers, textures, shader programs) across different contexts. So sharing WebGLRenderTarget across multiple renderers is just not doable.

Comments are closed.