Search code examples
unity-game-engineclipping

Unity Camera Clipping Issue


I'm having an issue with my camera, it is clipping one of my 3D models (cf images below).

enter image description here enter image description here

My camera Near Clipping Planes is already at its lowest value and all my shaders have an opaque rendering mode.

It only does that with the 3D models I generated with Fuse CC. The one I did with Blender don't clip! Any ideas? Thanks!


Solution

  • The actual problem seems to be that your models' bounds are not correct. Frustrum culling allows your GPU to skip rendering models that are out of sight by testing their bounds against the camera frustrum. This is important if you want good rendering performance. So just disabling it is not the best idea, if it is only to work around a simple issue like incorrect bounds.

    If you select your mesh renderer in the scene, you should see it surrounded by a wireframe cube. That cube visualizes your meshs bounds. You should see them fit quite well on your Blender models, and be way off on your Fuse CC models.

    Once you've verified that your Fuse CC models' bounds are off, you can try and fix them manually or by changing the import settings.

    Reasons why the bounds can be off:

    • You are importing the model without animations. If Unity does not know how the model will be animated, it will most likely set the bounds too tight
    • You are using Vertex shaders that distort the model in a way that makes it reach out of its bounds
    • You are programmatically moving bones around at runtime, either by IK, Ragdolls or similar

    All of these can be fixed by adjusting the bounds on your mesh in the editor so that they leave enough room for your runtime animations/modifications.

    The bounds are chosen well, when all of the following are true:

    • The mesh never reaches out of bounds (as visualized by the wireframe cube)
    • The bounds are as tight as possible without violating the first rule