Dynamic refraction for AR

Hello,

Using Dynamic Refraction (‘useDynamicRefraction’), is it possible to achieve an effect like this—glass refraction combined with the camera feed? Do you have any advice on how I can get started?

what part of this scene is camera feed, and what you want to add using rendering?

The glass cup at the center is the only 3d, and the rest is the camera feed.I want the refraction effect on the cup dynamically while the camera feed changes, like the hand getting refracted through the cup when trying to grab.

Thank you

Unless you’re using WebXR that maybe supports a depth, you cannot tell what is behind and what is in front of the cup, so you’d for sure get some artifacts from this. Especially if few fingers are behind the cap and some in front of it.

If you can assume the whole camera feed is behind (the background), this is more doable. I’m not entirely sure how you’d go about getting the camera feed to be rendered first, so that the dynamic refraction can sample it … but assuming this can be done, refraction should work (with the limitation I mentioned)

Currently, it seems like turning refraction higher than zero makes the material disappear when in an AR scene. I don’t even need the above mentioned camera based refraction, I’d settle for only refracting the other scene elements.