Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 umurcg · Feb 01, 2017 at 06:29 PM · shadersdepthmask

How can I use depth-mask shader

Hello,

I am trying to use plane for hiding objects behind it. I used shader from wiki.

http://wiki.unity3d.com/index.php?title=DepthMask

I followed instructions, added script to object that I want to hide. And added shader to mask object. While it hides object that I want, it also creates a odd effect on plane. I just want to see skybox on the plane.

Note that I don't know anything about shaders and computer graphics.

Thank you :)

alt text

capture.jpg (92.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 FortisVenaliter · Feb 01, 2017 at 06:49 PM 0
Share

Did you apply the proper RenderQueue values for your shader(s) like the post you linked to described?

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by cainehoratio · Aug 29, 2018 at 02:33 PM

I have some problems with the SetRenderQueue script.

It says the "renderer.materials" part not correct.,I have a problem with the SetRenderQueue script.

renderer.materials part not correct.


2018-08-29-16-25-16-arbarc-microsoft-visual-studio.jpg (30.3 kB)
2018-08-29-16-25-16-arbarc-microsoft-visual-studio.jpg (30.3 kB)
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 DCordoba · Nov 05, 2018 at 05:54 AM 0
Share

isn't my intention to make nechro-bumping, just give a comment if someone in the future get the same problem, the script of the wiki was developed to unity 3.4.1 in order to solve this problem, in unity 5 change on line 19:

 $$anonymous$$aterial[] materials = renderer.materials;

to

 $$anonymous$$aterial[] materials = (($$anonymous$$eshRenderer)transform.GetComponent<$$anonymous$$eshRenderer>()).materials;

this will get all the materials to the object you want to hide, assu$$anonymous$$g u have a mesh renderer atached to this object, and this have at least one material...

avatar image
0

Answer by umurcg · Feb 01, 2017 at 06:50 PM

Okay, I found the solution. Actually I was doing everything right except my values was 3000 and 3020 for queue. But I saw in another question, it should be 2999 on mask and 3000 on objects that I want to hide.

I don't know the reason but it works with those values.

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

68 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 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 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 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

Apply underwater effect below a deformed surface mesh's vertices? 0 Answers

How to make the Skybox visible only through a window? 3 Answers

Material that punches transparent hole in camera's view? 0 Answers

Depth mask with alpha / adding alpha to frag grabpass shader 0 Answers

Shader For cut hole and alpha blend 1 Answer


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