Yeah I did notice the use of the ‘useFBO’ hook but at the time I was unsuccessful in integrating it in my own project. I was hoping for a bit of context so I could better understand what the solution was doing…
However in the meantime I kept taking stabs at it and I managed to implement the solution with a bit of help from AI to understand what was happening in the useFrame.
For anyone else who comes across this, and wishes to ‘exclude’ a ‘mesh’ from being ‘visible’ to another mesh, the logic is as follows:
Get reference to the mesh you wish to exclude
Create a ‘render target’ using ‘useFBO’ hook
Pass the render target to the ‘buffer’ property on the MeshTransmissionMaterial
Use useFrame hook to:
Hide the object you don’t want effected by the transmission material
Set the created ‘render target’ using the useFBO hook by with the setRenderTarget method
Render the scene by passing in the current scene + camera
Set the render target to null using the setRenderTarget method
Unhide the initial object that we hid from the scene.
Hey, sorry didn’t got time to!
For you and for the others: MeshTransmissionMaterial - Drei , as you can see on the MeshTransmissionMat doc :
buffer?: THREE.Texture
/** transmissionSampler, you can use the threejs transmission sampler texture that is
* generated once for all transmissive materials. The upside is that it can be faster if you
* use multiple MeshPhysical and Transmission materials, the downside is that transmissive materials
* using this can't see other transparent or transmissive objects nor do you have control over the
* buffer and its resolution, default: false */