Jump to content

  • Log In with Google      Sign In   
  • Create Account


Far Mesh Become Invisible


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Medo3337   Members   -  Reputation: 620

Like
0Likes
Like

Posted 22 March 2013 - 12:57 PM

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



Sponsor:

#2 zacaj   Members   -  Reputation: 643

Like
1Likes
Like

Posted 22 March 2013 - 01:45 PM

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

#3 Medo3337   Members   -  Reputation: 620

Like
0Likes
Like

Posted 22 March 2013 - 02:01 PM

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, 22 March 2013 - 02:02 PM.


#4 Migi0027   Crossbones+   -  Reputation: 1234

Like
2Likes
Like

Posted 22 March 2013 - 03:18 PM

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?



#5 Medo3337   Members   -  Reputation: 620

Like
0Likes
Like

Posted 22 March 2013 - 05:02 PM

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?



#6 0r0d   Members   -  Reputation: 797

Like
0Likes
Like

Posted 23 March 2013 - 04:37 AM

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.


#7 Medo3337   Members   -  Reputation: 620

Like
0Likes
Like

Posted 23 March 2013 - 06:43 AM

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






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS