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
2
Question by KJIB · Feb 06, 2013 at 01:43 PM · camerafov

How to render part of FOV?

I have a number of machines networked and I want to show a wide field of view by showing part of that view on each machine.

Obviously if I have 3 machines and I simply attach a camera to the networked "player" and point each camera in a different direction, I will get distortion on the left and right views compared to what I want.

A solution would be to specify the same wide FOV on each camera but to tell each camera to render only a portion of this.

Attached is a diagram where I show the simple version (that results in distortion) at the top and what I want to do at the bottom.

How can I render (full view port) only a specific range of the FOV (e.g. 0-40 degrees from an FOV of 120)? alt text

partial fov camera rendering diagram.png (25.1 kB)
Comment
Add comment · Show 10
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 Berenger · Feb 06, 2013 at 01:54 PM 0
Share

I've never thought about it, but maybe you could try this, if you have Unity pro :

Use a single camera with a wide fov that render in a render texture. Then use GUI.DrawTextureWithTexCoords to display that texture on screen with those parameters :

  • Left : (screenRect, renderTexture, new Rect( 0f, 0f, 1f / 3f, 1f ))

  • $$anonymous$$iddle : (screenRect, renderTexture, new Rect( 1f / 3f, 0f, 1f / 3f, 1f ))

  • Right: (screenRect, renderTexture, new Rect( 2f / 3f, 0f, 1f / 3f, 1f ))

avatar image KJIB · Feb 06, 2013 at 02:01 PM 0
Share

I thought of that but in my case I'd need a massive texture as each screen might be 1920x1024 or larger... It will also presumable really affect the frame rate because I will have to render 3x the resolution (i.e. 5760x1024). This solution would be in-efficient for memory and bad for frame rate (but I do appreciate your input).

avatar image Berenger · Feb 06, 2013 at 02:15 PM 0
Share

You'd need to render only part of the FOV then, but that doesn't seem possible. I moved my answer here, so you're still marked as unanswered.

avatar image KJIB · Feb 07, 2013 at 01:57 PM 0
Share

Another problem with trying to use a render texture is that the maximum width is 2048 pixels and I need 5760. I was hoping to at least try this method by setting the view port rect to 1/3 of the width and see what happens but without being able to set a big enough texture this solution is a non-starter.

Perhaps there is a way to make a custom camera although I could find no code to inherit from etc.

Any ideas, anyone?

avatar image Dave-Carlile · Feb 07, 2013 at 02:24 PM 0
Share

Probably not exactly what you want, but it looks like this guy had some success: http://forum.unity3d.com/threads/93224-how-to-set-up-multiple-cameras-in-a-scene-rendering-to-multiple-displays

Also, maybe you can do something with the camera's viewport?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Bunny83 · Feb 07, 2013 at 04:49 PM

As i already mentioned in the comment above, just use the second script example on this page. It actually does exactly what you want. You can set the left and right planes manually. For example:

     screen       leftvalue      rightvalue
     --------------------------------------
     left         -0.4           -0.2
     center       -0.2            0.2
     right         0.2            0.4

You can't set the fov directly in this case. Usually the right / left / top / bottom values are calculated from the given fov value and the screens aspect ratio.

You might want to include the aspect ratio as well, but it depends on your actual screen resolution(s).

Do you use 3 identical screens?

Comment
Add comment · Show 1 · 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 KJIB · Feb 08, 2013 at 09:47 AM 0
Share

O$$anonymous$$, I can see that this is along the right lines but the values you give do not result in what I would expect but it was enough to get me going along what seems the right line so thank you Bunny83.

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

13 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

Related Questions

Camera movement in a 2D? (like angry birds) 1 Answer

Minimap camera display size. 1 Answer

How to accurately zoom (not dolly) and pan Camera to mouse click position 1 Answer

Is it possible to show only a part of what camera sees 1 Answer

2D is zoomed in/out on different ios devices 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