Sign in to follow this  
andrew_12

camera FOV in games

Recommended Posts

andrew_12    100
I have a 3rd and 1st person camera modes in my game, but I have 80 camera lense FOV for both of them. Ive never gave too much importance to this and used that value after tests. But now I think this IS important for adding more realism. So, what values are recommended or used in practice?

And finally, Im thinking of changing my skydome object to be rendered by another camera with higher FOV. Is this a good idea? What should I set for this one?

Share this post


Link to post
Share on other sites
xytor    136
Whatever you think looks good. Human eyes vary and are not rectangles, so just play around with the number until it looks good.

http://en.wikipedia.org/wiki/Visual_field

Share this post


Link to post
Share on other sites
Hodgman    51223
The sky should be rendered with the same FOV as the rest of the world..

IIRC the COD games default to 60 degress but let you change it from 45 to 80.
Some older shooters used 90, which I liked at the time, but it looks weird to me now.

If you want the screen to be a "correct" 3rd person window, measure the average distance that a person sits from their monitor, and the width/height of the monitor, then use trigonometry to figure out what the angle is from one edge of the screen to the other ;)


Also -- are you currently using vertical-FOV or horizontal-FOV values? This changes the way that wide-screen monitors will behave compared to 5:4/4:3 monitors.

Share this post


Link to post
Share on other sites
VirtualVoid    121
for FOV computing i'm using this simple thing :



float aspectRatio = static_cast<float>(m_WindowWidth / m_WindowHeight);
float fovy = 2 * atan(aspectRatio) * 180 / 3.14f;

gluPerspective(fovy, aspectRatio, zNear, zFar);

Share this post


Link to post
Share on other sites
andrew_12    100
OK.

Though Ive heard of people using another camera to render the sky with a different FOV.
My sky is currently set to be render behind everything else but is actually small. Should I just scale it?

Share this post


Link to post
Share on other sites
szecs    2990
Skydome means a sphere. The camera should be always in its center. What happens if you are inside a sphere and scale that sphere? Nothing from the camera's point of view. Just think about it.

You're doing something wrong, for example not placing the camera in the center.

Share this post


Link to post
Share on other sites
Murdocki    285
a skydome isn't the same as a sphere, it's more of a spherical cap but yeah about the rendering with different camera part.
You might need to eventually, you could for one just render with the same camera as the player is viewing trough. You can then re-use the z-buffer for some fragment rejection (assuming you aren't rendering your sky first). But later when you might want to have reflections somewhere, what's going to happen with the clouds you didn't render trough the player's camera?

just depends on if you really need the whole skydome to be drawn i think

Share this post


Link to post
Share on other sites
szecs    2990
Quote:
Original post by Murdocki
a skydome isn't the same as a sphere, it's more of a spherical cap but yeah about the rendering with different camera part.
You might need to eventually, you could for one just render with the same camera as the player is viewing trough. You can then re-use the z-buffer for some fragment rejection (assuming you aren't rendering your sky first). But later when you might want to have reflections somewhere, what's going to happen with the clouds you didn't render trough the player's camera?

just depends on if you really need the whole skydome to be drawn i think


No. Not the same camera. IT HAS TO BE IN THE CENTER OF THE SKYDOME. Otherwise you could fly out of it. Unless you make it infinitely big, which is the same as a small dome with the camera centered.

Share this post


Link to post
Share on other sites
szecs    2990
Quote:
Original post by andrew_12
Right, forget that sentence.

So do I rememebr it wrong that a skydome is rendered by another camera with different fov by some?


I guess you remember wrong. Different camera but the same fov.

Share this post


Link to post
Share on other sites
Murdocki    285
what are you asking anyway? rendering custom clouds or whatever to your skydome or the actual drawing of the skydome with the scene?

for the last one it doesn't really make sense to use two cameras, you just need to use the inverse of the camera's view matrix's translation as world matrix. This ensures the object you draw with this matrix always is around the camera. Then if you render it first, you need to disable zwriting ( so your vertices dont have to be at infinite range, make sure they are behind the near clip distance though ).

if using shaders you can output the xyww components of your transformed vertices and render the skybox after all opaque objects. The xyww enforces that the z / w results in 1 which means far clip distance. You will want to render your sky after opaque objects because this allows you fragment rejection while rendering the sky.

Share this post


Link to post
Share on other sites
zedz    291
>>Some older shooters used 90, which I liked at the time, but it looks weird to me now.

the reason was cause it was computationally easier to calculate things at 90deg.
back in the days before GPUs this made a difference, since 10years its nonissue.

I think I normally use a horizontal FOV of 60

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this