Some context. Above are the code and the resulting image for it in Peter Shirley's Raytracing in one weekend's book. As you can see from the code, he adds in some spheres. And yet in the final image there are 2 ellipsoids side by side. I just can't fathom why it is so, no matter how many time I looked at the code. Can anyone explain to me? Here's the link to the source code. https://github.com/petershirley/raytracinginoneweekend
Asked
Active
Viewed 3,782 times
9
-
2This looks normal and is caused by the perspective camera being close to the spheres and having a large FOV value. – PaulHK Nov 02 '18 at 05:29
-
Btw, this is not exclusive to ray tracing. – Sebastian Mach Nov 02 '18 at 11:00
1 Answers
16
Shapes appearing stretched in the periphery is a consequence of perspective projection. The wider the field of view (FOV) is, the stronger the stretching effect gets.
To demonstrate the effect I wrote a quick example on ShaderToy: https://www.shadertoy.com/view/MltBW2
As you can see on the images below (corresponding to FOV of 40, 80 and 120; if I didn't make any mistake), this becomes especially noticeable with wide FOV, like 90° and above.

Julien Guertault
- 4,420
- 2
- 23
- 47
-
Nice example. It might help to have some kind of a texture (e.g. a grid) on the ground plane, though; otherwise it's hard to tell the difference between changing the view angle and just moving the camera. (See also: dolly zoom.) – Ilmari Karonen Nov 02 '18 at 11:47
-
2It should also be noted that this effect typically happens with a high-FOV relative to the distance of the objects from the camera. It looks unnatural because you usually don't see objects from that close to your eyes. At least, not without quickly turning your eyes. – Nicol Bolas Nov 02 '18 at 13:56