Shader material from threejs drei

Hello guys,
I want to use this shader https://github.com/pmndrs/drei/blob/master/src/materials/MeshRefractionMaterial.tsx
in my babylon scene is it possible to do that?

In theory it’s possible, as in the end it’s only shader code.

However, you will have to know a bit of Threejs and Babylon.js to know how things work in both engines and to port the code to Babylon.

Also, in this case, there are additional complexities because the code is using a BVH structure to compute intersections, so you will also have to port the code that build this structure, which is coming from three-mesh-bvh. As you can see, there’s a bit of code there, so it’s definitely not a small task to port this refraction shader to Babylon.