Old GS raycasting method has a fundamental flaw which makes calculating cursor world position dependent on screen aspect ratio, specifically only accurate when screen is 1:1. Now introducing a new way to get raycast position. We use the camera space depth to compute the offset between camera and raycast position, and converting it back to world space. The result is a smooth & accurate spatial cursor, always at the center of mouse cursor, regardless of the screen aspect ratio.
Old GS raycasting method has a fundamental flaw which makes calculating cursor world position dependent on screen aspect ratio, specifically only accurate when screen is 1:1. Now introducing a new way to get raycast position. We use the camera space depth to compute the offset between camera and raycast position, and converting it back to world space. The result is a smooth & accurate spatial cursor, always at the center of mouse cursor, regardless of the screen aspect ratio.
https://github.com/user-attachments/assets/4642e6dc-e7f5-4b1c-8ce6-7d4f656698a6