- Home /
360 degree camera FOV?
Is it possible for a camera have a full field of view of 360 degrees?
The point is to have a player character in a FPS/TPS game have an ability to look everywhere at once. The image would be such of a 360' panorama image both horizontally and vertically fitted across the entire screen. Distortions do not matter, as it is simply a temporary ability the player may toggle on/off.
Answer by Marnix · Feb 08, 2012 at 02:52 PM
Well it is possible actually. But you need to have PRO...
Check this function: `Camera.RenderToCubemap`
It makes a cubemap and you can say which sides of the cubemap you need. Rendering this to a long rendertexture can make it possible to show the cubemap back on screen. It needs some coding, but yes it is possible.
Answer by DaveA · Aug 03, 2012 at 12:37 AM
You could also have two cameras of 180 degrees each, one forward the other rear facing, and render side-by-side.
Sorry, but it is impossible to render a 180 degree camera. You could render 4 90 degree camera's, but it would create a nasty edge because of the non-existing camera distortion. I tried it once with 90 4 degree camera's. That works out out, but takes some time.
Answer by CHPedersen · Feb 08, 2012 at 02:20 PM
This is impossible, because the camera model used in standard computer graphics is based on a 2-dimensional rectangular viewport (to fit it to a screen). You can read this article on graphical perspective to learn more:
http://en.wikipedia.org/wiki/Perspective_%28graphical%29
The short version is that the width of the plane onto which the scene is projected approaches infinity when the field of view approaches 180 degrees, and 0 when FOV ~ 0. That's why Unity's cameras have the FOV value limited to 1-179.
Real world cameras with fields of view higher than 180 do not project the scene onto a 2D rectangular surface, they use a cylindar instead, and what you see in that YouTube video is what happens when you project 360 degrees onto a cylindar and then unwrap the cylindar's surface to a 2D sheet instead.
But, as said, the cameras of computer graphics aren't mathematically designed that way.
Answer by Reactorcore · Feb 08, 2012 at 06:47 PM
Thanks for the replies, both of you.
I'm definitely going to read that wiki page you suggested, Christian H Pedersen. It wouldn't hurt to learn how this stuff works and what limitation should one consider. Thanks.
The scripting reference says the Camera.RenderToCubemap that Marnix suggested might be quite expensive to do in real time, but even if it would work at a slower FPS or with a simplified wireframe view, it would still be perfect for the purpose. Its just a quick awareness booster the player could do anytime, not the main game camera, so this is exactly what I'm looking for.
However since I do not have unity pro, I'll need to implement this feature much later when I can afford to buy pro. I'll probably find the answer later on how to pull this off when the time comes.
Actually, you can set a number of interesting options, like the resolution or the layers that need to be rendered. Also, you can (if you are a student) buy a commercial year license for less than the default 1000 euros. See www.studica.com for more info.
Your answer