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
6
Question by George · Oct 26, 2010 at 01:59 AM · camerarendertexturescreenshotprojection-matrix

Taking huge screenshots using camera array?

I posted this on the forums but that place is like a graveyard.

I'm sure you can do this - CryEngine has some mode where you can take a screenshot up to 28800x16200. This is probably achieved by taking tiled shots. I'm aware you can use a Render Texture to take a largish screenshot, but the drawback is anything else that is resolution dependent, like screen-space effects or mip-mapping are significantly degraded.

I can take a shot using a RT at 4961x3508 (A3 @ 300 dpi), but water reflections are still using their 256 textures, and loading the buffer up further than 4096 textures would kill it!

So yes, how would I go about doing this, manipulating a matrix so that i can grab an image in tiles while maintaining the perspective distortion?

Here's some images to demonstrate:

  1. The Camera alt text

  2. This solution wouldn't work as each camera has it's own perspective rather than that portion of the base cameras projection. alt text

  3. This is the solution that would work - it shifts the project horizontally and vertically to get a portion of the whole, so that together it forms a coherent image with perspective. But I don't know how to set this up. The first top-left tile is tinted to make it clearer. alt text

alt text

Here's my current progress. It's doing what I want in that if you put them together and scale them down, they match the output of a single camera. What's wrong is how i'm calculating their FOV and matrix offsets. The code is messy as hell:

http://www.dukecg.net/TiledScreenCapture.unitypackage

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

3 Replies

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

Answer by _Petroz · Oct 26, 2010 at 04:23 AM

I don't think #3 will work either because the perspective of the camera which are off center will be different. Also the aspect ratio will be different. If this is possible using separate cameras I think it would be non-trivial.

http://www.freeimagehosting.net/uploads/7fcbe2b37c.png

img

You can tile orthographic cameras like #1 but then there will be no perspective.

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 George · Oct 26, 2010 at 08:57 AM 0
Share

I'm onto what I think is vertical/horizontal shift in the camera projection matrix - $$anonymous$$02 is the X shift and $$anonymous$$12 is the Y shift. it appears to shift the camera without breaking the perspective/center point. I'll post back when I get results.

avatar image George · Oct 26, 2010 at 12:21 PM 0
Share

Edited with my solution so far - i'd love some input on how to properly calculate the FOV/offsets. The relavent code is in ProjectionShiftController.InstantiateCameraArray()

avatar image
1

Answer by Joshua 3 · Oct 26, 2010 at 02:00 PM

The way to create a tiled screenshot is to use the PerspectiveOffCenter function found here: http://unity3d.com/support/documentation/ScriptReference/Camera-projectionMatrix.html to create the projection matrix for the camera. Basically the left, right, bottom, top are the sides of each tile as in the graphic you provided.

I have gotten that working myself but unfortunately changing the projection matrix makes the shadows incorrect for me. see: http://answers.unity3d.com/questions/10071/off-centre-projection-matrix-breaks-cascaded-shadows

Once you get your tiling done can you post if your shadows work properly?

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 Herman-Tulleken · Oct 26, 2010 at 04:51 AM

What you could try is to put your camera far enough away, and then rotate it for each tile. This will give you some distortion (because you are essentially mapping a sphere to a plane), but it is worth a try to see how the result looks. The setup should be pretty simple: to make things easier, use a square resolution.

Then simply take the shots, something like this:

for(i = -k; i <= k; i++) { for (j = -k; j <= k; j++) { Quaternion rotation = Quaternion.Euler(camera.fov * i, camera.fov * j, 0); camera.transform.rotation = rotation;

 images[i + k,j + k] = TakeScreenShot();

} }

StichTogether(images)

The stitch algorithm here need only place the images next to each other. The value 2*k+1 gives the number of tiles in each direction.

You might need to make certain objects invisible for your camera (so that you can put it far enough away to get a nice range).

Once you have this base case going, you can start playing with ideas to improve the result.

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

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

No one has followed this question yet.

Related Questions

Taking screenshot from a second camera 0 Answers

Wierd Screen Shot Problem, texture of screen shot looks different in editor and in system. 1 Answer

Problem with screenshot on render texture 0 Answers

Rendering screenshot using multiple cameras and one rendertexture 0 Answers

Camera.RenderWithShader not working as of Unity 5.3? 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