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
0
Question by user-8371 (google) · Jan 17, 2011 at 05:59 PM · shaderlayersoverlapparallaxgraphic

shader/layer overlapping problem

Hello Unity Answers Community.

I've got the following problem: My current Project is a 2D side scrolling game that uses the parallax effect with some Planes as Layers in the Background. The Problem is that they are overlapping at some times whats an very odd behaviour. I just have no clue how to fix this.

Ive attached also some screens so it might be clearer whats my problem. I tried also different spaces between the planes in the background without any success.

http://s7.directupload.net/file/d/2407/xpq8pz43_jpg.htm

http://s13.directupload.net/file/d/2407/exnrfqqw_jpg.htm

http://s3.directupload.net/file/d/2407/raju7ylu_jpg.htm

http://s3.directupload.net/file/d/2407/mhh6u9g9_jpg.htm

Comment
Add comment · Show 1
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 yoyo · Jan 19, 2011 at 07:20 AM 0
Share

Some tips here as well ... http://answers.unity3d.com/questions/707/rendering-order

1 Reply

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

Answer by Jessy · Jan 17, 2011 at 06:34 PM

It's easy to fix this, because they're flat an in the same plane. Put the ones you want in front in a later queue. You don't need need to worry about positioning them in the Z axis (as long as your shader uses ZWrite Off, which is typical).

http://unity3d.com/support/documentation/ScriptReference/Material-renderQueue.html

There really is no thing as transparency. Instead, meshes just blend their colors into what's already been rendered. So, you have to ensure that the rendering occurs in the proper order, or weird-looking things happens. I talk about the problem near the end of this video.

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 user-8371 (google) · Jan 18, 2011 at 03:08 PM 0
Share

how should I set up the script? I'm new to scripting and have no clue how to write that script. As far as I understand there are predefined classes like # Background # Geometry # Transparent and # Overlay but I can also define custom ones in between. So should I write a script with those new render queques i want to have or should I edit/add the specific tags to the shaders I use?

avatar image Jessy · Jan 18, 2011 at 04:00 PM 0
Share

I specifically linked to that documentation page, because you don't need to worry about editing shaders for this. The shaders you're using are probably in the Transparent queue, which as the docs say, is 3000. You could base your new values off of that, but you might get better performance using values between 2001-2499. Those queues are not sorted by depth, so they yield possibly better performance; you'd have to test.

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

No one has followed this question yet.

Related Questions

Layer Dependent Reflections 1 Answer

Pages overlapping problem 1 Answer

MeshRenderer with GUI/Text Shader is always in front of my 3D objects, how do I fix this? 0 Answers

[2D]X-Ray Sprites 0 Answers

Writing Parallax Terrain shader 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