Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Yoraiz0r · Apr 26, 2015 at 05:35 PM · camerarendermeshrenderer

Why does my mesh not render at certain angles?

I have a humanoid character with an animator controller and a camera attached to the neck bone, with an IK script making the hand and neck look towards another game object.

The camera is close in front of the character's face, with minimal clipping plain of 0.01 (lowest possible), However at certain angles the character disappears from the camera.

http://i.imgur.com/JoAnxV2.gifv

The gif video above is how the problem looks, note that the mesh does not disappear in the inspector nor would it disappear if I push my camera far back to "always see the whole character".

I have no idea what is the issue, I've confirmed clipping plain editing would only make certain bones disappear, however the entire object turns invisible at the mentioned angles.

Any help on getting the hand to never disappear would be highly appreciated.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlwaysSunny · Apr 26, 2015 at 05:35 PM 0
Share

To my knowledge, any time you see "your" limbs in an first-person perspective, these are models rigged and animated specifically for that type of perspective.

So I'm thinking even if you can solve this issue, you shouldn't be using the same animation set for first-person anyway.

Sorry but I'm not personally certain what conditions can cause skinned mesh renderers to stop drawing. I'm sure at least some of their AABB needs to be visible to the camera; perhaps it is not at certain thresholds in this dynamic process.

$$anonymous$$aybe someone with that experience can assist. Have a look at their documentation in the mean time.

avatar image maccabbe · Apr 26, 2015 at 06:37 PM 0
Share

It seems this might be caused by occlusion culling, Does this issue occur if you turn it off by going to the camera in the inspector and unchecking the occlusion culling checkbox?

avatar image Yoraiz0r · Apr 26, 2015 at 10:02 PM 0
Share

I've tried that and it bore no fruit, after some more reading online so far I'm convinced this is related to the shaders used rather than the camera, as using the standard assets "Ethan" character does not produce this bug.

6 Replies

· Add your reply
  • Sort: 
avatar image
24

Answer by Yoraiz0r · May 03, 2015 at 12:33 PM

Answering my own question in case anyone takes a look at it in the future. Apparently the camera can mark certain game objects as 'behind it' and when that happens they will not render on it at all, the solution however is pretty simple!

Simply go to the meshrenderer of your game object and check the 'Update when offscreen' box, and the object should no longer randomly disappear from the camera.

Comment
Add comment · Show 9 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Taylor-Libonati · Jul 09, 2015 at 05:11 PM 9
Share

For anyone else looking here. Only skinned mesh renderers have this option. If you are using a straight $$anonymous$$esh Renderer and it is disappearing when it shouldn't be you are most likely generating the mesh yourself and should be sure to call RecalculateBounds after any manipulation of the mesh.

avatar image crash664 Taylor-Libonati · Apr 07, 2016 at 03:14 AM 1
Share

Thanks for this, because I have this exact problem, and I am generating the mesh myself. After each manipulation I was calling RecalculateNormals, so I also tried, RecalculateBounds, but i'm still having this problem. Any ideas?

avatar image Taylor-Libonati crash664 · Nov 02, 2017 at 08:09 PM 1
Share

Just now seeing this. Depending on your use case you may need to calculate your own bounding box for a mesh like monotoan mentions in an answer below.

avatar image fusecore · Jul 20, 2016 at 11:35 AM 1
Share

I had this problem too, and while Update when offscreen fixes it, you might want to check where the bounding boxes of your character's skinned meshes are. $$anonymous$$y skinned meshes were still referring to the prefab's root bone's transform, which was at 0,0,0. So if the camera looked away from 0,0,0, the meshes would disappear even though the game object was in view. Fixed this by setting the right transform to the meshanimator.

avatar image IkerCastillo · Jun 16, 2020 at 12:47 AM 0
Share

Thanks a lot:)

avatar image Natzke · Nov 16, 2020 at 06:04 AM 0
Share

For just a regular mesh, when I encountered this issue I found that;

mesh.RecalculateBounds();

worked to let the camera know where the mesh was.

avatar image Max_Bol · Nov 19, 2020 at 10:38 PM 0
Share

This is a principle created by one of the culling part of the rendering process of the engine. Since offscreen skinned mesh are pretty much a pure waste of rendering memory, the engine is, by default, turning off the mesh if the camera doesn't detect its point of origin.

The offscreen culling is done by an internal series of raycast from the camera toward all objects (or culling groups) with an active rendering in the scene. In the case of skinned mesh, there are no culling groups, so it's done on a per-object basic. When the option "Update when offscreen" is turned off, the camera cast a raycast toward the point of origin of the skinned mesh renderer model and, if returns true, render the skinned model. When the option is turned on, the camera create 8 raycast call toward the 8 corners of the bounding box of the skinned mesh renderer and if any returns true, the model is rendered.

This might sound extreme, but that's exactly why the camera Far clipping planes should be set to the $$anonymous$$imum of the best result and not just to an insane high number. The distance of each raycast cast from the camera is based on that value.

Culling group (for regular mesh renderer) allow the camera to cast toward 8 corners for multiple mesh renderers at once (and ignore the mesh renderers themselves). As such, a culling group of 7 or less mesh doesn't require a group while 8 or more allows to save quite a bit of CPU processing the rendering.

Show more comments
avatar image
7

Answer by monotoan · Oct 04, 2017 at 02:50 PM

Adjusting the bounds of your mesh can be helpful for solving this problem.

The bounds dictate the area in which the mesh will render, and if you're doing any kind of deformations on the vertices/geometry of the mesh, that may move part or all of it outside of those bounds.

To test this, use something like the following code to set the bounds very high, and see if it fixes the issue:

 private void Start()
     {
         Mesh m = GetComponent<MeshFilter>().mesh;
         mesh.bounds = new Bounds(Vector3.zero, Vector3.one * 2000);

         //mesh.bounds is in local/object space, so
         //setting a center of zero and extents of 2000 will
         //expand the bounds into a box 2000 units wide around
         //the center of the object
     }
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Slender2000 · Jun 26, 2020 at 04:06 PM 0
Share

Thank you so much. It helped me a lot. By the way there is bug. Should be "m.bounds" :-)

avatar image daniyalnz2 · Jul 03, 2021 at 07:26 AM 0
Share

THANK YOU SO MUCH!!!!!!!

avatar image
1

Answer by retrobullet · Nov 26, 2018 at 07:05 PM

look of OCCLUSION IS OFFFF and test with different settings when putting back on again

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by holdingjupiter · Jun 18, 2016 at 05:36 AM

I'm having a similar problem witch some blend shape created automatic doors. If I look at it from around a 45 degree angle or more, the door disappears. The doors look good other than that so I might solve it in some banal copy way. Any thoughts on that problem other than the solutions listed here?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Salvation-Au · Sep 29, 2017 at 04:20 PM

I had a very similar problem of meshes not rendering at certain angles or being able to see through to other parts of the mesh. I switched from the Unity standard shader to a custom shader and the issue went away.

May not be a solution but may help others troubleshoot their own issues.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Set renderable objects on camera without Layers 2 Answers

Render a list of objects into a Texture2D array 0 Answers

Render to texture with disabled camera allways generates error 0 Answers

Can i render a camera to a gui texture? 1 Answer

Detailed render for far away objects? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges