# Have a problem with renderer fisheye effect and raycasting

**URL:** <https://discourse.threejs.org/t/have-a-problem-with-renderer-fisheye-effect-and-raycasting/57326>\
**Category:** Questions\
**Tags:** fisheye, raycaster\
**Created:** [October 23, 2023, 1:23pm UTC](https://discourse.threejs.org/t/have-a-problem-with-renderer-fisheye-effect-and-raycasting/57326 "2023-10-23T13:23:05Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![drcmda](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@drcmda](https://discourse.threejs.org/u/drcmda)\
**Post date:** [October 24, 2023, 8:29am UTC](https://discourse.threejs.org/t/have-a-problem-with-renderer-fisheye-effect-and-raycasting/57326/3 "2023-10-24T08:29:26Z")

</div>

[drei has a fisheye](https://github.com/pmndrs/drei#fisheye) that works with raycasting, try this out (click the spinning cube)

> **[ThreeJS Journey Lv 1 Fisheye - CodeSandbox](https://codesandbox.io/s/7qytdw)**
>
> A recreation of the first level from https://threejs-journey.com.

if you want this in vanilla, the math was explained in full detail here [How to use THREE.RayCaster with a sphere-projected envmap?](https://discourse.threejs.org/t/how-to-use-three-raycaster-with-a-sphere-projected-envmap/56803)

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.

---

_[View the full topic](https://discourse.threejs.org/t/have-a-problem-with-renderer-fisheye-effect-and-raycasting/57326)._
