First person: Minimum rendering distance?


This is a first person game. Trying a few things, I wanted to add a weapon - Strangely, it seems that the camera doesn’t render the items under a certain radius.

Have a look at this picture:

hmm doesn’t look good, I know. Moreover, it’s harder to get the meaning of this if you’re a left hander :slight_smile:

The “thing” on the right of the screen is the front part of an ak-47.

Here is my “player” physics with the ak-47 attached to the camera node, so that it moves together:

Any idea why the “closer” part is not rendered? I’m afraid imagination is not enough to help the player believe he’s holding an ak 47 :slight_smile:


Looking closely at the gun, the visible gray part looks just like a standard cube and not the rounded model in the bottom pic.

Maybe that has something to do with it.

That's near frustum culling… you need to render the weapon in a separate pass, possibly with different scales and depth ranges.

Or you could simply reduce the near frustum to a lower value at the price of depth buffer precision.

cam.setFrustumPerspective( 45.0f, (float) display.getWidth() / (float) display.getHeight(), 0.1f, 1000 );

depth buffer

“As the zNear  clipping plane is set increasingly closer to 0.0, the effective precision of the depth buffer decreases dramatically. Moving the zFar clipping plane further away from the eye always has a negative impact on depth buffer precision, but it’s not one as dramatic as moving the zNear clipping plane.”

Another thing you can do is somewhat a cheat… Place a bigger model a little bit further to the front so that it gives the illusion that the object is actually closer. This is inaccurate for projection purposes, but won't kill your Z-buffer precision. Besides you can still use a different model for the avatar and remove that fake gun there  :wink:

Perhaps You can add the gun to the "fpsNode" its the static Node for HUD stuff.

But I'm not sure