• 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 CyberChroma · Jan 21, 2021 at 04:52 AM · camerashaderspost processingcullingmultiple cameras

Cutting a hole in the camera

alt text


Hi!

Short version:

I have 3 groups of objects. I want to cut a hole in camera 1 and render camera 2 be$$anonymous$$nd it, using the red objects as clipping objects. All the objects are in the same scene. I've tried using shader graphs applied to the camera.


Long version:

So the above 4 part image is basically the effect I am trying to create. So I have a group of objects being rendered by camera 1 (picture 1), a second group of objects, in the same place in the same scene, being rendered by camera 2 (picture 2), with its own skybox (solid colours for an easy example). I've already done t$$anonymous$$s using culling layers. Then I have a t$$anonymous$$rd group of objects, the culling objects (picture 3), shown by the red sphere, with the group 1 objects be$$anonymous$$nd it for context, w$$anonymous$$ch could be black or any other colour, t$$anonymous$$s doesn't matter, as long as it's an object defining where to clip. Picture 4 is the end effect I am trying to ac$$anonymous$$eve. What I've done so far is having camera 1 rendering on top of camera 2 using the render priority. Now I'm trying to make a shader on camera 1 to somehow test all of the pixels, and if they match the exact color of a culling object, then render not$$anonymous$$ng for that pixel (including the skybox, w$$anonymous$$ch has been my toughest problem). Using any other way of determining where to cut pixels using meshes would be great! I don't know if having a color restriction like t$$anonymous$$s will be a pain to deal with later! Either way, then camera 2 would render normally.

If possible, I would like to do t$$anonymous$$s using the shader graph as appose to manually programming a shader. I would say I'm a pretty experienced coder, but not with programming shaders. I'm also using the Universal RP. As well, it would be great if I could have some sort of black border surrounding the holes or some kind of polish to it like that.

I've been doing a lot of research on t$$anonymous$$s, and can make normal shaders just fine, but unfortunately there is not a lot of information out there on applying shader graph shaders to the camera itself. All the images here were made with Photoshop, although I did make a shader to get the red sphere to render as all 1 colour and ignore lighting information.

If it does matter, I would then like to render UI elements on top of all t$$anonymous$$s.


Help solving any part of t$$anonymous$$s mystery would be very much appreciated! Thank you!

temp1.jpg (128.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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

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

Dynamic Camera Masking (Voronoi Split-Screen) 1 Answer

Post-process masking? 0 Answers

Rendering Depth Correctly With Multiple Cameras 0 Answers

Unity 5 image effects for multiple cameras 1 Answer

Fake Volumetrics via custom bloom 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