I am trying to capture a PBR material (Substance) in a gl texture that I can use in a custom emscripten library. I have all of the plumbing to make this work and I have had some success but I am questioning if I am (a) going about this the best way and (b) what might I be doing incorrectly with the current setup. I have tested the technique in this playground. That appears to work as I expected.
When I use a similar technique, basically just using babylon to render the Substance material (gltf) and attempt to capture the
underlyingResource of the
RenderTargetTexture to feed to the emscripten bindings I am using. It doesn’t appear to capture the texture in a way that I expected. If I set the
clearColor of the
RenderTargetTexture I do see that color in the result using the emscripten library. When looking at a capture of the commands with spectorjs, things mostly look right. I have attached the spectorjs capture capture 20_43_48.zip (967.9 KB)
Let me know if there is a better approach to this.
Thanks in advance!