- Home /
How to modify the unity camera so that it renders like a GoPro camera
My game needs to have a camera that has the same field of view and camera depth perspective as a GoPro camera. Typically this means a horizontal field of view out at around 150 to 160 degrees. If you try to stretch the default unity camera field of view out to this level the camera image distorts terribly. I did find an asset in the asset store that basically renders larger than your screen resolution and then allows you through render textures expand the field of view out without getting the nasty camera distortion that goes with it.
However, the issue with this solution is that you end up rendering very large screen resolutions and this destroys game frame rate.
I've started to think that maybe I need to do something with camera projection matrices but as a novice in this field I don't know that this is the correct approach.
Simple emulation with fisheye shaders doesn't really do the job, this is just a graphical effect rather than an accurate recreation of a GoPro lens.
So my question comes down to what is the correct approach / methodology to change the default unity camera into a GoPro camera with accurate field of view and distance perspective without unacceptable stretching and distortion of the image?
Were you able to find a solution for creating a Unity camera that matches the GoPro camera field of view etc?
Answer by BloodMarked · Jan 19, 2018 at 05:32 PM
i want to do the same but there is no simple solution, which is why you dont see it in many games (i only know of kane&lynch2)
is is the same problem that the inverse projection for vr has (magnification in the center, where we rather want detail, more unwanted detail in peripheral vision
it can be done in the vertex shader, but the edges of the polygons will still remain straight, meaning you need a much higher tesselation.
this technique is quite popular for google cardboard apps: https://www.youtube.com/watch?v=yJVkdsZc9YA
in desktop vr it is done by rendering the peripheral vision at a lower resolution (or checkerboard rendering) and the center image at a higher resolution, then combining both. p.e. valves techniques: https://www.youtube.com/watch?v=eIlb688pUu4
i dont think these techniques have been applied to a fisheye lens effect yet, simply because it is too expensive
sadly i myself lack knowledge & skill to port these techniques to a non-vr fisheye shader
Your answer
Follow this Question
Related Questions
WorldToViewportPoint and ViewportToWorldPoint math 2 Answers
Replicating the Minecraft Acid Mod 1 Answer
Camera from 3dsmax to Unity -> Lens mm 3 Answers
Camera Transition between two cameras 0 Answers
Camera preview only shows skybox 7 Answers