Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by · Aug 12, 2016 at 03:20 PM · 2dmesh3drendering

Close meshes render in 2D, but not 3D

I'm making a 2D map using 4 overlapping meshes to give it some randomness. I have them in a specific order, each on a z-axis of 0,-0.01,-0.02,-0.03 respectively.

Everything renders well in 2D, both in the scene editor and an orthographic camera. However, as soon as I switch to 3D to add a bit of a tilt and perspective to the map, the order of the 4 meshes becomes random. Both in the scene editor and switching a camera to perspective.

It seems if I increase the magnitude of the z axis value to close to between 0.5 and 1, then I can get one mesh to appear atop another, but then everything is skewed by that difference in height.

It seems like this is a 3D rendering issue, and should be solvable, but I can't find any information on it.

Comment
Add comment · Show 2
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 · Aug 11, 2016 at 03:12 AM 0
Share

I think I can narrow this down further. It may have something to do with the shader. I have the Sprite/Default shader applied to the mesh material, which works on 2D.

The closest I can come to a solution is by changing the shader to 'unlit transparent cutout', but the alpha is not smooth on this like the sprite shader in 2D. Ins$$anonymous$$d, all the alpha edges on the meshes are choppy. Is there another shader that could work? Is there another workaround?

avatar image · Aug 11, 2016 at 03:23 AM 0
Share

After further search on this problem and shaders, I found the correct answer here:

http://answers.unity3d.com/questions/609021/how-to-fix-transparent-rendering-problem.html

Long story short, you can set the renderqueue of the material to different values, so that the order is always the same. This works for 2D as well as 3D. Not obvious, but it works.

 Renderer renderer = $$anonymous$$esh32x32PrefabInstance.GetComponent<Renderer>();          
 renderer.material.renderQueue = 3;  

A higher render queue number renders atop lower render numbers.

0 Replies

· Add your reply
  • Sort: 

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Passing Underneath Section of a Mesh 0 Answers

How do you bend a 2d texture in 3d?,How do you bend a 2D object in 3D? 0 Answers

How can I make a large 2d tile map into mesh for easier rendering 1 Answer

Create 3D mesh from PNG 0 Answers

2D vs 3D mesh deformation. 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