I’ve added raycaster to intersect my red squares and change cursor style, but it working not properly, ray casted with wrong XY coordinates, any chance to solve this problem ?
Renderer fisheye I’ve provided with effectComposer and distortion texture
Not really. The raycaster doesn’t know anything about the fisheye effect… to make it work, you would have to manually transform your input mouse x/y and ray to account for the distortion, which sounds Really hard and somewhat arbitrary.
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.
p.s.s. you can do high/full resolution fisheye in post by rendering to a rendertarget that is larger than the viewport… but yeah if drei has a fisheye that handles raycasting… that sounds like a good approach.
i tried this with @N8Three and we concluded it wasn’t working at least. it’s the view to the behind that’s throwing it off, it has to bend around the fish eye in a full circle. even a wider fov wouldn’t catch that. we eventually gave up trying.
i think thats barrel distortion? i did try a couple of distortion shaders, i really liked this one btw Shader - Shadertoy BETA i still wanted to try if i can perhaps merge that with fisheye.