Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by dyankov · Oct 23, 2013 at 03:36 AM · isometric

Z-index issues

Update 4 - Solution/Workaround

It seems like this issue occurs when you have multiple objects with the Transparent shaders. In my case - the player and the column. When I changed the shader of the column to Transparent/Cutout the problem disappeared. The drawback is that now the column has jagged edges, but I think it's much better than jagged edges on the player, since he's animated.

I hope this helps anyone.

Update 3

It seems like this is a known limitation of the Transparent shader. From the Unity docs:

Transparent Cutout Properties

Cutout shader is an alternative way of displaying transparent objects. Differences between Cutout and regular Transparent shaders are:

  • This shader cannot have partially transparent areas. Everything will be either fully opaque or fully transparent.

  • Objects using this shader can cast and receive shadows!

  • The graphical sorting problems normally associated with Transparent shaders do not occur when using this shader.

Link: http://docs.unity3d.com/Documentation/Components/shader-TransCutBumpedSpecular.html

Update 2

When I switch to the Transparent/Cutout/Diffuse shader the Z-index problem is gone and I have transparency, but also jagged edges around my sprite. What can I do about those jagged edges?

Update 1

I'm using a Transparent/Diffuse material for the player's plane. When I change it to just Diffuse, the Z-index problem is gone, but the transparency is gone.

Question

I'm getting this weird issue - see the shot below. You can clearly see that the character plane is in front of the column, but the column gets rendered in front of it. I have tried searching for similar issues, they are all about Z fighting, which I understand is something different.

So as you can see there is plenty of space between the planes. A couple of things to note: - the column is using a billboarding script, which rotates it on the Y axis towards the camera. Turning off the script makes no difference. - I tried playing with the camera. Changing the clip planes makes no difference. The only think that sort of fixed it is when I got the camera super close to the plane with a really wide viewing angle. Obviously, that's not an option :) - the character can walk next to the wall (on the left of the screenshot) without any z-index issues and the planes even intersect.

Any ideas?

alt text

Here is the hierarchy in the scene as well as all affected objects' positions at the time of the glitch.

alt text

untitled-1.jpg (135.0 kB)
untitled-2.jpg (208.9 kB)
Comment
Add comment · Show 12
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 dyankov · Oct 23, 2013 at 02:51 PM 0
Share

I guess trial and error will have to fix it. I will make a new scene and try to isolate the problem. I'm thinking scene scale might have something to do with it.

avatar image Tomer-Barkan · Oct 23, 2013 at 02:56 PM 0
Share

Do you have only the one camera? Is the plane rotation facing the camera correctly? Share the positions and rotations of the camera, the columns, and the character plane. If they are children of other objects, share their positions as well.

avatar image dyankov · Oct 23, 2013 at 03:06 PM 0
Share

I made a few screens. That's the info that you requested, right?

avatar image Tomer-Barkan · Oct 23, 2013 at 03:11 PM 0
Share

Yes. Ok, It's not so simple to understand what's going on like this, maybe try making a test with just the 3 objects that are all root objects (without parents).

Also, I see you have several cameras. Are they all but one disabled? Otherwise they will draw one on top of the other based on their "Depth" attribute.

avatar image dyankov · Oct 23, 2013 at 03:16 PM 0
Share

I have just one camera - "playerCamera". Where are the other cameras?

Show more comments

2 Replies

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

Answer by dyankov · Oct 23, 2013 at 05:45 PM

It seems like this is a known limitation of the Transparent shader. From the Unity docs:

Transparent Cutout Properties

Cutout shader is an alternative way of displaying transparent objects. Differences between Cutout and regular Transparent shaders are:

  • This shader cannot have partially transparent areas. Everything will be either fully opaque or fully transparent.

  • Objects using this shader can cast and receive shadows!

  • The graphical sorting problems normally associated with Transparent shaders do not occur when using this shader.

Link: http://docs.unity3d.com/Documentation/Components/shader-TransCutBumpedSpecular.html

This issue occurs when you have multiple objects with the Transparent shaders. In my case - the player and the column. When I changed the shader of the column to Transparent/Cutout the problem disappeared. The drawback is that now the column has jagged edges, but I think it's much better than jagged edges on the player, since he's animated.

I hope this helps anyone.

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 doneykoo · Feb 07, 2017 at 03:27 AM 0
Share

thanks a lot! this question and answer clarified my big doubt/confusion on rendering sorting the semi-transparent-edged animated sprites mixing with 3d scene objects.

avatar image
0

Answer by Seyed_Morteza_Kamaly · Jun 10, 2017 at 05:41 AM

Under the SubShader section, add +1 to the item in the “Queue” section. For me, this became “Queue” = “Transparent+1”.

     SubShader
     {
     Tags{"Queue" = "Transparent+1"}
         Cull Off ZWrite Off ZTest Always
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

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

17 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

Related Questions

A node in a childnode? 1 Answer

Running a Unity 4.6 game on Unity 4.5.2 - Possible? 1 Answer

Game Crashes on iphone3gs and iPod touch but work fine on iPhone 4s 1 Answer

Player not taking damage with hit collidor 1 Answer

how can i create vertical graph chart(bar) with GUI texture and effect to the bar? 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