• 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 /
  • Help Room /
avatar image
0
Question by sandvitch · May 11, 2016 at 12:30 PM · camerarenderingmask

Replace the camera's depth field view with another camera's view ?

Hello everyone,

I hope I don't post a doublon question but i didn't find an exact answer for it, so here I am :

I would like to know if it's possible to simply replace the depth field view of a camera (the Z buffer) with his "Clear mask" set as "Depth only" or "Don't clear" with the view of another camera.

In others words, for example, I have two cameras :

alt text

Let' say that the blue and red objects are at the same distance from their camera.

Even if I set the camera 2 with a lower Depth, I will see the blue object inside the red one (because of the distance from their camera), i don't understand why.

The result I'm looking for, is the "grey" in the camera 1 (because it's set as Depth Only, so the skybox is not rendered) is replaced by the view the camera 2 so : I get the reb object and the skybox as an immobile background even when the camera 1 or the blue object moves.

Thanks you for your help :)

example.png (16.6 kB)
Comment
Add comment · Show 1
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 Lewwwer · Jul 16, 2016 at 02:21 PM 0
Share

Hello! If you set the depth of the camera 2 lower to the camera 1, you will get the image of the camera 1 rendered on top of the camera 2. So the engine renders the camera 2's image and on top of that it renders the camera 1's image. this means that you will see the blue object. In your example given that these objects are spheres and the blue sphere is a bit smaller. Rendering the camera 2 it will give you the skybox and the red sphere as a circle. After rendering the camera 1 it will give you the blue sphere as a blue circle and the rest of the image will be the same as it was in the camera 2.

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

66 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

Related Questions

Cut through camera render and display LITERALLY NOTHINGNESS 0 Answers

Disabling a specific light for only a specific camera in Universal Render Pipeline (URP) 0 Answers

How to see a prefab from inside it? 1 Answer

Render 2 cameras with same depth. Not split screen. 0 Answers

Rendering issue on android 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges