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 JasonM · Nov 11, 2011 at 12:16 AM · cameramultipledepthorthographicperspective

overlay perspective on orthographic camera

Hi all,

I've learned a lot about multiple cameras, and I think I've got it mostly figured out. There's one thing that has me stuck. I have 3 cameras in the scene, each for a specific purpose.

  1. I have a perspective camera for my 3rd person character. (depth 0, clear skybox).

  2. I have an orthographic camera for my HUD (depth 1, clear depth only).

  3. I have another perspective camera for an item in the HUD (depth 2, clear depth only).

So I want to have cameras 2 and 3 in the same position, and place the 3d object as though it's in front of the HUD (in a thumbnail). The problem is that when camera 3 is perspective the orthographic camera 2 becomes invisible. I'm certain I've got everything setup right, as its only when i switch it to perspective that it disappears. I believe I have three options now:

  1. make my HUD camera 2 a perspective that appears to be flat (everything needs to align perfectly).

  2. somehow get my HUD to appear in between the gameplay and the 3d item. (maybe im missing something, this would be ideal).

  3. Use something like a renderTexture to show the 3d objects over the HUD (this sounds bad and again, everything needs to align nicely).

Hopefully someone out there knows why my orthographic is hidden behind the perspective. Or another alternative...

Comment
Add comment · Show 5
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 syclamoth · Nov 11, 2011 at 06:56 AM 0
Share

Yeah, use 'don't clear' for the ones on top, not 'depth clear'.

avatar image ShreddinPB · Nov 11, 2011 at 11:30 PM 0
Share

Im looking into this also.. seems fine if they are all persp or all ortho it works, but if you mix cams it doesnt seem to, for me at least

avatar image JasonM · Nov 14, 2011 at 02:54 PM 0
Share

I think I've tried every combination of clear flags. Still the only way I can make it work is for the top 2 cameras to be orthographic. $$anonymous$$akes no sense!

avatar image musiko · Sep 19, 2014 at 11:07 AM 0
Share

Could anyone please explain why it is impossible for perpsective camera to overlay an orthographic camera?

avatar image Alucadmo · Jun 09, 2015 at 09:53 PM 0
Share

Hello everyone,

I'm struggling with this same issue in a project I'm working on. Did you ever find a solution to the problem?

I actually have a strange work around where when I start the scene initially the perspective camera is hidden behind the orthographic camera, but if I change the clear flag settings back and forth while the project is playing I can actually get the perspective camera to overlay properly. But no matter what settings I choose, I can't seem to get it to work from the get go! Hah!

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by squishyBit · Nov 11, 2011 at 05:55 AM

Might not be the case but are you sure you set the camera's clear flags to "don't clear" or "depth only"?

Comment
Add comment · Show 3 · 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 JasonM · Nov 14, 2011 at 02:55 PM 0
Share

it cant be the clear flags if it works when both are orthographic, although it would seem the clear flags dont work when you have persp and ortho.

avatar image JasonM · Nov 14, 2011 at 02:55 PM 0
Share

I'm going to use renderTextures for now until this can be sorted out

avatar image JasonM · Nov 14, 2011 at 03:11 PM 0
Share

Could it have something to do with the rendering path? I might put together a test project so an expert can look into it

avatar image
1

Answer by Stilghar · Nov 29, 2014 at 06:20 PM

Using forward rendering seems to work, not sure why it doesn't for the other rendering paths.

Comment
Add comment · Show 2 · 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 ATMEthan · Jul 27, 2015 at 08:49 PM 1
Share

I just had a similar issue with 3 cameras. Background Camera(oath), $$anonymous$$ain Camera(perspect), Foreground Camera(ortho) and setting them to forward rendering path was the answer for me. Depth is bg camera = 1, main = 2, foreground = 3. That is important too. Now my cameras render properly. First the foreground cam, then main, and lastly background camera.

avatar image Baintastic ATMEthan · Oct 26, 2016 at 04:01 AM 0
Share

Setting the depth was my problem -- my depths were the same so it worked fine originally and when when I closed and re-opened unity, it didn't work. Thanks AT$$anonymous$$Ethan.

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Editor Camera Perspective 1 Answer

Draw orthographic visuals (e.g. health bar) in perspective scene? 4 Answers

Using a perspective camera can an object act as if viewed by orthographic camera? 1 Answer

Camera 2D RPG in perspective 1 Answer

fluent animation from orthographic to perspective projection 2 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