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 stiltskin · Jul 21, 2012 at 07:39 PM · transparencylayersmask

masking geo with a full screen texture

I'm trying to make an effect where I have a full screen circle gradient that would mask out a layer to be able to see through it.

ex: I have trees on one layer rendered by it's own camera. That layer also has a plane with a screen-space shader on it which I would like to use to mask out those trees to be able to see through them at the center. For whatever reason I can't get this to work. To give you a visual - imagine using a vignette as a mask for a layer's transparency.

is this at all possible? could it have anything to do with trying to mask out transparency with a deferred render?

http://forum.unity3d.com/threads/144581-full-screen-texture-mask-to-see-through-a-layer-how

Comment
Add comment · Show 6
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 ScroodgeM · Jul 21, 2012 at 07:57 PM 0
Share

do you need just something like this?

http://answers.unity3d.com/questions/267000/depth-mask-with-blending-edge.html

just explain what should be shown where mask covers image?

avatar image ScroodgeM · Jul 21, 2012 at 08:35 PM 0
Share

does two images you want lerp between are rendered by simgle camera?

can all object of one of theese two layers have one shader? if yes, you can use little custoized shader that will render with mask based on screen position

avatar image stiltskin · Jul 23, 2012 at 04:09 AM 0
Share

unfortunately, it's a lot more than simply lerping two images. I'm trying to basically have all the trees in my game not render around the player so that we can see the player at all times.

avatar image ScroodgeM · Jul 23, 2012 at 07:13 AM 0
Share

yes i see that it's a lot more the two images. that's why i asked about one shader for whole part of scene

avatar image stiltskin · Jul 23, 2012 at 03:53 PM 0
Share

hmmm... one thing I was thinking about is having a custom shader for all the trees that also include a "mask" input... which goes along with what you're saying (if I understand correctly). $$anonymous$$aybe the way to treat this is not by making the trees out as a group, but individually, while all using the same screen-space texture multiplied into the alpha. I hope this doesn't give me crazy overdraw issues.

I'll give that a go. And keep you posted.

Thanks!

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by stiltskin · Jul 21, 2012 at 08:28 PM

hmmm. this seem pretty close actually. That sample shader didn't seem to work though. here's a thread that I put up so that you can see an example:

http://forum.unity3d.com/threads/144581-full-screen-texture-mask-to-see-through-a-layer-how

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 stiltskin · Jul 21, 2012 at 08:28 PM

that seems pretty close. I added a url to a thread I started with some images to better explain. I tried the sample shader included but it didn't seem to work.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Everything above the player to be semi-transparent 1 Answer

How do I get my camera to render 2 culling masks in scripts? 2 Answers

mask one gameObject mesh by another mesh vertex transparency 1 Answer

Shadercode for alphatesting and transparency at the same time 0 Answers

Is it possible to change an animator layer mask through 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