Drei MeshTransmissionMaterial strange issue when multipass rendering to Texture

Hi,

we meet strange behaviour regarding using MeshTransmissionMaterial in this situation :

We want to have backside rendering as in the original source code, but using our own buffers.
Please check this sandbox : https://codesandbox.io/p/devbox/bug-meshtrans-forked-p3k7xn?workspaceId=ws_En6M89RQEGonvD2BjVHorK

The issue is that the second rendering pass works bad when rendering to a texture, and render ok when rendering to framebuffer. You can switch situation by clicking “renderToTexture” checkbox in the UI.

We notice also that when redering two times in frontside mode all is ok, when rendering two times in backside mode all is ok… the alternance between frontside and backside seems the source of the issue.

expected rendering ::


(this good rendering happens when rendering to framebuffer)

Rendering issue when rendering second pass to FBO ::

Thanks in advance !