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 firasdeep · Jun 02, 2012 at 02:42 PM · shadergameobjectscreenmarketing

How to mask gameObject by gameObject

Hello

How to mask gameObject by gameObject is there any shader or plugin to do that

thx

(Firas)

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 Wolfram · Jun 02, 2012 at 03:15 PM 0
Share

Can you please explain im more detail what you mean by "mask gameObject by gameObject", and what exactly you are trying to accomplish? It is not clear.

4 Replies

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

Answer by Wolfram · Jun 03, 2012 at 09:36 AM

This is what you are looking for: http://wiki.unity3d.com/index.php?title=DepthMask

(EDIT: outdated link fixed, thanks @ArturoSR and @jokim)

Comment
Add comment · Show 3 · 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 firasdeep · Jun 03, 2012 at 05:14 PM 0
Share

Super thx brother :) That exactly what i want.

avatar image TheShadyColombian · Jun 02, 2015 at 12:44 AM 0
Share

The example project requires Cheetah3D ;(

avatar image Wolfram · Jun 02, 2015 at 09:46 AM 0
Share

@xXJuanXx It works with Unity 4.x - it seems in Unity 5 the existing mesh+meta data is being ignored/destroyed.

However, just construct your own example: create an object that will be the mask, the invisible part that is supposed to "cut away" parts of other GameObjects. Apply the "$$anonymous$$asked/$$anonymous$$ask" shader to that object.

For this object to actually cut away stuff, just add the script "SetRenderQueue" to all object that should be cut. That's all.

Note you will have to be in Play mode to see the effect.

avatar image
1

Answer by ArturoSR · Sep 03, 2014 at 04:35 PM

The Depth Mask Shader it's no longer in the site mentioned before, here it is the actual unity wiki site.

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 jokim · Sep 03, 2014 at 04:40 PM 1
Share

and here's the actual Depth $$anonymous$$ask link

avatar image
1

Answer by tanyanzhi · Jun 02, 2015 at 01:00 AM

There is a component called Mask in UGUI could help you, if you are using UGUI.

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
avatar image
0

Answer by Berenger · Jun 02, 2012 at 03:03 PM

You can disable the renderer or deactivate the gameobject. This is going to make the object disappear instantly. If you want it to fade, you need a transparent shader. There is the built-in ones and you can download them here if you want to look them up.

Comment
Add comment · Show 3 · 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 firasdeep · Jun 02, 2012 at 08:06 PM 0
Share

thx brother for your answer but i want to show part of gameobject , not disabled totally

i hope that is there a solution

avatar image Berenger · Jun 02, 2012 at 09:03 PM 0
Share

Then you should go with a transparent shader and an alpha map, if there is only one mesh.

avatar image firasdeep · Jun 02, 2012 at 09:49 PM 0
Share

ok i will try it, thx for help

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to add second shader to gameobject as a mask for RenderWithShader 0 Answers

overlap between scenes!!! 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How to Get Gameobject position on screen resolution that not passed the resolution to set 0 Answers

Switch to New Shader and Back to Original object's Shader in C# Script 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