Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 PedramAUS · May 29, 2012 at 03:37 AM · camerarenderingmultipleoutputreal-time

Capturing the real-time output of multiple cameras in a scene

If there are 20 cameras in a scene and I need to capture the outputs of those cameras with different resolutions at least 15 fps. What would the best solution?

In other words, if I have a powerful enough machine, can Unity render multiple outputs at the same time? What are the constrains?

Preferably I don't want to split my screen and show the camera outputs next to each other and get the camera outputs, because in that case I am limiting my self to the screen size.

The other way, would be capturing each output in one frame, for example, if the scene is rendered 150 fps. I can get 10 cameras' output, each in a frame.

But all the mentioned solutions are not applicable for me. I even don't need to display the outputs. as far as I can store the outputs in the memory or file, it solves my problem.

Comment
Add comment
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

1 Reply

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

Answer by Paulius-Liekis · May 29, 2012 at 08:20 AM

Prepare:

  1. Assign RenderTargets to each camera

  2. Set desired resolution on each render target

Then in each frame do a loop through all cameras and perform this:

  1. Set render target active (or camera active?)

  2. Create new texture the same size as render target. This will tell next step which camera is should read.

  3. Do Texture2D.ReadPixels. This steps copies pixes from render target to the texture

  4. Optional: Texture2D.EncodeToPNG and then write them to disk, but this will slow down things a lot.

In general capturing one camera to disk is a slow thing, so capturing many will be a problem. Capturing to memory might be better, but you will fill your memory fast, unless your resolutions are small.

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 Dillipkumar · Apr 17, 2017 at 01:30 PM 0
Share

I believe, we can use Texture2D.ReadPixels to read the pixels from the screen, not from the texture. even though you are going to pass the dimensions of the render texture to this function, that's not going to work.

There is another function Texture2D.LoadRawTextureData(IntPtr data, int size) where the data which is passed can get from the render texture using GetNativeTexturePtr() function.

I have used this approach for capturing multiple camera outputs simultaneously.But the problem is Texture2D.LoadRawTextureData(IntPtr data, int size) is causing exception.i am not sure about the reason.

I am trying this on the free version.is this approach working for anybody?

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

6 People are following this question.

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

Related Questions

Two camera rendering an object differents textures 2 Answers

Two outputs, one camera? 1 Answer

How would you render a seemlessly wrapping scene? 1 Answer

Unity - Render XR game objects onto processed camera image 0 Answers

Best way to have a camera only see certain objects? 1 Answer


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