Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Adagio-81 · Oct 17, 2015 at 05:55 PM · shadermaterialmask

Masking texture based on other texture

I'm searching for a way to mask parts of a texture on some objects based on another texture element, but I'm not quite sure how to handle it. Let's say I have several gameobjects with a Sprite and I have another texture that defines what should be visible for the user, how do I accomplish this?

alt text

In the above example I'm trying to explain what I mean. Image 1 is the graphical representation of the objects in the game. This is how the game looks at the beginning of the level. Image 2 is the mask of what should be visible. As can be seen is a part in the right side has been deleted Image 3 is how the final product should be, where the part from image 2 that was deleted also should be deleted on the objects visible to the player.

I have tried to search around for a solution on how to do it, but so far the closest I have come is finding this:

http://answers.unity3d.com/questions/732993/is-it-possible-to-create-a-transparent-empty-textu.html

But unfortunately it doesn't seem to work here. I guess I'm doing something wrong, but I have no idea what.

I have created two materials for the game. One of them uses the shader Unlit/Transparent and the second material uses the shader copied from the above link from user tanoshimi. The first material I have used on the sprites seen in Image 1. The second material I have used on the sprite seen in Image 2.

The only thing it does it make the sprite in Image 2 totally invisible.

Any idea what I'm doing wrong here? This shaders and materials are completely new elements for me

example-cut.jpg (51.7 kB)
Comment
Add comment
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

0 Replies

· Add your reply
  • Sort: 

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

32 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

Related Questions

Problem with sprite materials/shaders inside a mask 1 Answer

How to create a shader that does not test for z-depth but obeys UI Mask 3 Answers

What is the best approach to mask players vision? 1 Answer

How to load 3d model(.obj) in device by programmatic. 0 Answers

Cut through camera render and display LITERALLY NOTHINGNESS 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