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
0
Question by krlsmnk · Jun 05, 2018 at 06:09 PM · rendertexturecameras

Rendering 2 Cameras without using Clear Flags

So the general concept I'm going for is a form of controlled teleportation. Game is 1st person, standard WASD controls, mouse look on capsule; nothing special.

I want a 2nd camera in the world to render to a plane that has a fixed position in the world (think a TV screen). This is typically done using a Render Texture. My 2nd camera isn't currently rendering the to plane. I just see gray, unsure why.

I want to remotely control the 2nd camera using the arrow keys, and have its view drawn to the plane. My WASD Controller script uses the Input axes, so I'll likely have to write a separate script to control the remote camera, but I should be able to handle that no problem.

When the character capsule walks through the plane (trigger collider enter), the character should teleport to where the remote camera is looking. I want the 2 cameras to "swap," essentially, and the travel plane to appear behind the character at his new location. This can likely be done with a position check and handoff, so nothing crazy complicated there, either.

All the tutorials and code I've seen for rendering multiple camera at the same time in Unity all use the Clear flags OR overlay both camera views to the main display. Neither of these will work for what I'm trying to do. I need the remote camera to render everything, even the skybox, so the player can understand where he is traversing to before he teleports there.

Is this even possible? If so, how could I accomplish it?

Secondly, any reason the render texture might not be drawing properly? I've adjusted the Depth value of both cameras and neither Depth(camera1) > Depth(camera2), Depth(camera1) == Depth(camera2), nor Depth(camera1) < Depth(camera2) have allowed the remote camera to render onto the plane. Any ideas on what's keeping it from drawing?

Comment
Add comment · Show 3
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 krlsmnk · Jun 08, 2018 at 10:09 PM 0
Share

Bump? It's been 3 days. :/

avatar image b1gry4n · Jun 08, 2018 at 11:50 PM 0
Share

another way to think of this, is ins$$anonymous$$d of a render texture, have 2 cameras on top of eachother that render different scene objects with a "portal" (your current render texture plane) as a clear flag for the top camera. if you think about it as layers, the top most camera wouldnt be drawing that planes space since its cleared, leaving the bottom camera able to render there. since the bottom layer camera sees the scene differently (draws only specific layers) it will render a different set of game objects inside that plane. idk if thats explained very well. its almost like having 2 photographs of different objects stacked right on top of eachother, but youre punching a hole in the top photograph to see the bottom

since theres 2 cameras rendering, youd be free to do whatever you want with that second camera and when the player walks through your portal, flip the cameras so now the top is the bottom

i dont have much experience with render textures, but it should be pretty straight forward. https://answers.unity.com/questions/477888/texture-showing-camera-view.html https://docs.unity3d.com/$$anonymous$$anual/class-RenderTexture.html

avatar image krlsmnk · Jun 09, 2018 at 07:49 AM 0
Share

I'm trying to avoid using the clear flags because I want the cameras to render to independent displays, not have some semitransparent overlay of both viewports on the same display.

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.

Follow this Question

Answers Answers and Comments

85 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

Related Questions

First Person Camera Pixelation 1 Answer

Procedurally generate icon textures 1 Answer

How can I force FPS per camera? 1 Answer

QualitySettings.antiAliasing vs RenderTexture.antiAliasing 0 Answers

Most efficient way to do Mercator camera projection 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