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 quazeryon · Nov 21, 2016 at 07:19 AM · camerashadergraphicsrendertextureblit

dynamic hole in layer / texture / camera

To simplify this issue:
i have two layers, each containing multiple gameobjects. One layer (without the playercharacter) should be rendered on top of the other (with the playercharacter) with a hole (transparent spot) over the playercharacter, which also moves with the playercharacter. (note that not whole gameobjects on the top layer should be invisible just parts of gameobjects near the playercharacter)

Attempts to solve it:

  • render the top layer on an own camera with a higher depth value, then add a shader which creates a transparent spot over the playercharacter (the cameras would be locked over the playercharacter, but that is acceptable) to the camera on top of it with a script which postprocessed the output (Graphics.Blit in OnRenderImage). Unfortunately the shader draws it's output on top of the output of the top-layer-camera which makes the added transparency irrelevant and it seams like the shader gets the output of both cameras.

  • render the top-layer-camera image to a rendertexture and only Graphics.Blit the postprocessed graphic on the screen doesn't seem to work.

  • adding a rendertexture with a shader for the hole in front of the lower-layer-camera which is the target for the top-layer-camera would be an option, but i would need to change the size of the rendertexture depending on the screensize and it feels like there could be a better option.

Did someone else have a similar problem or are there any better solutions to this?

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Multiple Blit problem 2 Answers

Blit into Texture2DArray slice not working in WebGL 0 Answers

Rendering a screen aligned quad with Graphics.blit - not working? 0 Answers

Applying post-processing effects to RenderTextures 1 Answer

OpenGL ES 2.0 support breaks simple shader 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