Sign in to follow this  
Followers 0
Medo Mex

Far Mesh Become Invisible

6 posts in this topic

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

0

Share this post


Link to post
Share on other sites
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
1

Share this post


Link to post
Share on other sites

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).

Edited by Medo3337
0

Share this post


Link to post
Share on other sites

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?

2

Share this post


Link to post
Share on other sites

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?

0

Share this post


Link to post
Share on other sites

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.
0

Share this post


Link to post
Share on other sites

@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?

0

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  
Followers 0