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
1
Question by ShmayFish · Nov 12, 2012 at 08:23 PM · cameralayersimage effectsgame object

How to make an object unaffected by image effects but can't be seen through walls?

I have a camera that has a sepia image effect on it, but I have a single object in my scene that I do not want to be affected by this. As such, I created 2 cameras and added that object to its own layer. I parented my original Main Camera to the secondary camera (so they will see the same view) and set the secondary camera to a depth of 1 and clear flags at depth only, while the main camera has a depth of 0 and is set to skybox for clear flags.

The culling mask on the secondary camera is set to only see the layer my object is on, while the Main Camera sees everything except that. The effect it as desired: the object still shows up in color while everything else is sepia. However, I can see this object through walls (which I have on the default layer). In addition, when I look around the scene, the object appears to slightly move with my camera instead of remaining where it is.

How can make walls obstruct my view of this object? I tried putting the walls on a separate layer and making this layer viewable by the secondary camera, which does block the view of the object, but for some reason the sepia no longer shows up. This is probably just me being stupid.

Thanks!

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
0

Answer by thebarryman · May 12, 2013 at 04:16 AM

Your clear flag is set to depth only, which means that when it comes time to render your colored object, the depth buffer is cleared. This is what causes your colored object to be seen through walls: there is no depth buffer to depth-test against.

Try setting your secondary camera's clear flag to "don't clear" and see what happens.

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

10 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

Related Questions

Unity - blur on one camera effects the other as well 0 Answers

Can camera effects like Motion blur, Vignette, Fisheye, etc. be fixed on a different axis than the one facing out from the camera? 0 Answers

Rendering a camera in front of a gui element 3 Answers

If camera renders Skybox some objects don't get shown 1 Answer

Blur Effect 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