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
0
Question by PeterJK · Jul 22, 2013 at 11:12 AM · camera

How to split one view frustum between multiple cameras?

Hey all,

I'm doing some experimentation...it might not seem obvious why one might want to do this, but bear with me.

Basically let's say I have one camera with one view frustum. I'd like to be able to render its view instead in a tiled way with 4 cameras. Effectively I'd like 4 cameras each responsible for one quarter of the frustum of the original camera. Their combined output should be exactly the same as the single original camera with one frustum. Their frustums, combined, should cover the same volume as the original camera.

Any ideas how I should set this up? I've tried messing with view port rect and fov but I think I'm on the wrong track... Thanks for any help.

Comment
Add comment · Show 4
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 AlucardJay · Jul 22, 2013 at 12:25 PM 0
Share

There may be some useful information here : http://answers.unity3d.com/questions/479774/how-to-render-the-same-scene-differently.html

Answer by Eric : Once you have the normalized viewport rects set so each camera is covering half the screen, you can use OffsetVanishingPoint to move the cameras' vanishing points so they match up.

avatar image PeterJK · Jul 22, 2013 at 02:15 PM 0
Share

Thanks! After a little bit of testing that seems to have put me on the right track.

I was concerned that using OffsetVanishingPoint wouldn't actually change the shape of the view frustum - e.g. affect collision detection between objects and the frustum - but it appears it does, even though in the editor the frustum's shape isn't altered. That is good :)

Just have to figure out the right parameters now, or a generic formula for working it out for different cameras.

I'm not sure if you want to add your comment as an answer? I'd be happy to accept it as the answer.

avatar image PeterJK · Jul 22, 2013 at 04:19 PM 0
Share

Hmm, actually, while this renders things correctly, it doesn't exactly do what I need.

For example if I have two cameras side by side, each rendering half of the view, OnBecameVisible is called when an object passes into either camera's frustum, and a geometry test will pass for both cameras even though it's only visible in one camera's view. I'd like to be able to split the frustum for visibility tests also.

Perhaps I need to construct custom planes and do my testing against those rather than the ones the camera provides.

avatar image Jamora · Jul 22, 2013 at 11:50 PM 0
Share

OnBecameVisible is called whenever any camera, incl. the Editor's scene view, renders an object. Have you looked into layers and culling masks? Could provide a way to have OnBecameVisible only be called for certain cameras.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by rich_seabirdsim · Jul 09, 2014 at 09:26 PM

If I understand you correctly, you just have to get the proper numbers in the rect and fov. But you also have to aim each camera in the proper direction.
So camera 1: x=0; y=0; w=.5; h =.5; camera 2: x=.5; y =0; w=.5; h =.5; camera 3: x=0; y=.5; w=.5; h =.5; camera 4: x=.5; y=.5; w=.5; h =.5;

This should tile 4 camera views for you into a single (100%) frustrum view. Then you'll have to adjust the FOVs as well as the camera rotations so that the cameras are displaying what you want.

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
avatar image
0

Answer by LazyElephant · Dec 18, 2015 at 10:42 PM

What you're looking for is called a Scissor rect. Unity doesn't implement it in their api, but you can do it with a simple script. I go through the setup step by step in this question http://answers.unity3d.com/questions/1112309/screen-is-2-cameras-with-each-different-properties.html#answer-1112586

This sets up only two cameras, but you can easily extend it to more.

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 LazyElephant · Dec 18, 2015 at 10:44 PM 0
Share

Just noticed this was from 2 years ago. I have no idea how it was brought up to the top again, but I'll leave this answer in case anyone else needs it.

avatar image jbarbeau · Dec 22, 2015 at 09:17 AM 0
Share

Thanks, LazyElephant I will look into this.

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

20 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

Related Questions

How to make camera position relative to a specific target. 1 Answer

WHY My Camera twitch ????? 0 Answers

is there any tricks while navigating the scenes with the camera 1 Answer

Question about ARcamera 0 Answers

Unity Advanced Water Problems 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