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 /
avatar image
1
Question by Cornelius12 · Mar 30, 2019 at 06:02 PM · layerspost processingcameras

Help I cant use multiple cameras with layers. [Solved]

Hello

I have not tried post processing before so i have no idea what im doing. I Have two cameras, one sees everything expect the gun and one sees only the gun. However when I press play there is only one camera active. Like the different cameras cant form a single picture. I made a short film because its difficult to explain something i dont understand. Heres the link. https://ufile.io/lho8w

I just wondered what settings I should use.

Thanks if someone cares

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Cornelius12 · Mar 31, 2019 at 01:59 PM

So I screwed around with the settings and apperantly found a solution. I set the deapth off both cameras to 1. And the camera that only sees the gun i set to Deapth only. I did some other stuff too but i dont know if that made any difference.alt textalt text


unity1.png (39.3 kB)
unity2.png (27.9 kB)
Comment
Add comment · Show 6 · 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 Bunny83 · Mar 31, 2019 at 03:10 PM 1
Share

Setting both cameras to depth 1 makes no sense since now it's arbitrary which camera is rendered first. So you should define the correct rendering order by giving the first camera (main camera) a lower depth value than the second one.


Of course the second camera must not clear the screen (color buffer), otherwise everything that the first camera has already rendered will be cleared again. And yes, since the main point of rendering the gun seperately in FPS games is to avoid z buffer clipping of the gun when you're close to a wall, you want to clear the depth buffer for the second camera.


If you set the second camera to "don't clear" there would be no point in using a second camera and the effect would be like just using a single camera for everything.

avatar image Cornelius12 Bunny83 · Mar 31, 2019 at 03:14 PM 0
Share

@Bunny83 Ok so I changed the main camera to 1 and the secondary weapon camera to 2. What kind of difference does it make?

avatar image RobAnthem Cornelius12 · Mar 31, 2019 at 03:45 PM 1
Share

It's a rendering order thing. If they're on the same layer its last enabled that takes priority. But flickering and other things can happen when rendering on the same layer. It's just not correct to do so. Camera depth is specifically for rendering order of cameras. The clear flags means when the camera will clear the existing frame to draw a new one, if you are set to "don't clear" then your camera will never clear the old frames data, meaning you're stacking your visuals over and over. If you had moving objects or the camera moved, you would see permanent trails of the movement being left in the camera render frame. Clearing depth only means that it will clear any rendered frames based on the frustrum depth. ($$anonymous$$ight be wrong on the last part, I'm sure bunny will correct me if I am).

Show more comments

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

105 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

Related Questions

How do you make a mesh visible to certain cameras? 1 Answer

Hide Lens Flare From Certain Cameras 0 Answers

2 Cameras: Top one doesn't render on mobile only (but colliders are still hit) 1 Answer

Same flare appearing in two diferent cameras 0 Answers

How can I mask a camera's display with an image? 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