• 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 shockreel · Mar 13, 2013 at 11:34 PM · shadermaterialsculling

How do I make an object invisible to one other object?

Is there a way to make an object appear invisible only to specific objects in a scene? I don't think I can do this with camera culling masks because the camera needs to see both objects in the scene. The problem is, at certain points during gameplay, one of the two objects moves behind the other and gets clipped. I am attaching 2 screen shots to better explain what's happening and what I'm trying to do.

Shot 1: You can see the water stream and particle system disappear behind the street and then reappear above the sidewalk. Shot 2: From a higher vantage point inside the scene, you can clearly see the water stream and particle system appearing above the street.

My question: Is there any way to tell the shader on the street plane to appear as invisible ONLY to the water stream and particle system?

alt text

alt text

shot1.png (418.0 kB)
shot2.png (400.8 kB)
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 Benproductions1 · Mar 14, 2013 at 12:05 AM 0
Share

Whats your setup? Normally the street shouldn't render above anything thats infront!

1 Reply

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

Answer by shockreel · Mar 14, 2013 at 03:12 AM

Ok. I figured it out, although still not entirely understanding the anomaly. I paused my game while the stream was extended and did some playing around with the shaders. Apparently, the shader on the water stream (a panning shader I created in Strumpy) as well as the mobile shader on the particle system behave additively when their objects are displayed against the shader used on the road plane (Transparent Diffuse) When Transparent Cutout Diffuse is used on the road instead, the problem goes away.

It would make sense to me if the additive shader was the one on top but it's more like the additive shader is on the bottom but canceling the top object out. ?? No worry. Problem solved.

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 Seth-Bergman · Mar 14, 2013 at 03:25 AM 0
Share

cutout shaders do an extra pass to deter$$anonymous$$e the clipping, probably why it updates correctly in that case, since it's doing a final pass :)

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

12 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

Related Questions

unity2d light system doesnt work 2 Answers

Alpha texture overlaying opaque texture, both with colors? 0 Answers

How to edit a shader to make it show sprites it's on without lighting? 0 Answers

Culling part of a sprite in Sprite Manager 2 1 Answer

Seamless Water Material on a Plane using Shader Graph 3 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