Far Mesh Become Invisible

Started by
5 comments, last by Medo Mex 11 years ago

Hi everyone,

Whenever a mesh go far away from the camera it become invisible, until the camera get close to it or it come closer, though I'm setting the camera farView to a very high number, I even tried to make the number higher but still having the same problem.

float NearView = 1.0f;

float farView = 100000000000000000000000000000000000000.0f

Advertisement
Numbers that big are going to be cut off. The computer can't store them. Because of depth buffer accuracy issues, you should generally never have the far distance be more than a few thousand. I'd recommend you use a smaller unit for your world

I tried setting farView to 100000000.0f (same when rendering the sky mesh) and the problem persist, the weird thing is that the sky is visible (even it's more far than other meshes).

I tried setting farView to 100000000.0f (same when rendering the sky mesh) and the problem persist, the weird thing is that the sky is visible (even it's more far than other meshes).

In my sky (skymap) system, if this is your case, I actually render a quad and then use the model view projection, and kind of trick the player to think it's far away, though it's not. This could be your case. And as zacaj recommended, if you really wan't such a far range, then 'use a smaller unit for your world', like:

Before:

CamSpeed = 3;

Tree.Scale = 3,3,3

After:

CamSpeed = 1

Tree.Scale = 1,1,1

And if you do all this for all things (with more properties), it will look exactly the same!

But just ask yourself this: Do I really need such a large FarView?

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Great advise! it will help solving some issues that I am having smile.png

How do I determine the appropriate unit size for the world?

In the scene, I have:

Sky

Terrain

Airstrike

I'm still wondering why when the unit size is large the airstrike is becoming invisible?

Hi everyone,

Whenever a mesh go far away from the camera it become invisible, until the camera get close to it or it come closer, though I'm setting the camera farView to a very high number, I even tried to make the number higher but still having the same problem.

float NearView = 1.0f;

float farView = 100000000000000000000000000000000000000.0f

Wow, seriously?? No wonder you're having depth buffer issues... the max range of a float is 10^37. Why are you trying to set zFar to 10^38?

Regardless, you're blowing your depth buffer precision out of the water. Setting the zNear too small, or zFar too high will cause z-fighting issues. It's never even occurred to me to try setting zFar to something like this, but I'd imagine you're getting horrible z-fighting everywhere.
I wouldnt recommend setting zNear less than 0.1f, or zFar much higher than around 10,000. These should be adequate numbers for any game.

@0r0d: I resolved the main issue by reducing the world unit size. Thanks to Migi0027 and zacaj!

Now, I'm wondering how can I determine the appropriate world unit size for the entire FPS game?

Also, in 3Ds Max, what is the appropriate terrain size (width and length) that can be considered large enough for a large mission?

This topic is closed to new replies.

Advertisement