Have a problem with renderer fisheye effect and raycasting

drei has a fisheye that works with raycasting, try this out (click the spinning cube)

if you want this in vanilla, the math was explained in full detail here How to use THREE.RayCaster with a sphere-projected envmap?

ps. i doubt you can get fisheye with postpro alone. you need a cubecamera because a real fisheye can see the behind. with postpro you may be able to warp your scene a bit but it won’t be close to the result above and you’ll loose detail/resolution in the process. if i was you i’d not bother with that and use cube mapping instead, and then you’ll also have the math necessary to figure out raycast. or, you use three with react and all you need to do is wrap your scene into <Fisheye>, that would certainly be the quickest.

2 Likes