• 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
1
Question by SamAgten · Feb 15, 2012 at 04:47 PM · blender

Unity Z-buffer error when displaying blender mesh

Hello everybody!

Before I ask my question I'll go over my setup: I'm trying to render 2D sprites with layers in a very literal way. In the simple example that I currently use, a sprite consist of a handdrawn body and a head. The sprite is constructed in blender by using two planes: one for the body and one for the head. The two planes are textured accordingly with the handdrawn body and head. The plane of the head is of course moved in front of the body to display the sprite correctly. Finally, I have assigned a bone to each plane so I can animate the sprite by moving the bones in blender while still being able to, for example, assign rigid bodies in Unity to the head and body seperately. One final thing of note is that in practice I have four planes instead of two (I have a mirrored version of the character taped to the back of the character so that I can flip him around, rather than having to mirror the uvs). I don't want to script the mesh into animation but it is crucial to what I am trying to achieve in the long run that all the animation is done in Blender.

Importing this mesh to Unity works like a charm except for the fact that the head is displayed behind the body, even though I can see clearly in the editor that the plane (or rather, the head transform) is positioned closer to the camera than the body. Keep in mind though that the character is treated as a single mesh in unity. If I have ruled out the possibility that the head displayed behind the body is in fact the mirrored version and that it would thus be a problem with the normals. Any idea how I can fix this?

Is unity's z-buffer unable to deal with disjunct meshes?

Much obliged,

Sam

Comment
Add comment
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 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Jessy · Feb 15, 2012 at 05:42 PM

Your shader blends. Blending is not order-independent. The Z Buffer is only a useful construct for opaque materials. If you can put your vertex array into the right order, that will solve the problem; search the forum for what "MikaMobile" has done.

Comment
Add comment · Show 1 · 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 SamAgten · Feb 15, 2012 at 11:41 PM 1
Share

Thanks, I read up on what $$anonymous$$ika$$anonymous$$obile has done and have fixed the problem.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

Need Advice on Direction for Apps 0 Answers

please help looking for animater for FPS 1 Answer

Blender Import Mesh Issues 1 Answer

Cloud recognition in Vuforia 0 Answers

Saving animation from blender and importing to unity 0 Answers


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