2
\$\begingroup\$

I have a scene (lest assume, large glass table I want to looking through) and I want to render with 4 displays (each 1920x1080). How can I set up camera for this, I want the "glass cube" to fill entire scene (all four displays).

If I use single perspective camera and I want to see entire scene, I got stretched image near sides - in other words only middle is correct and sides are stretch. If I correct this, than my scene is not filling entire window and is small.

I have tried to create single camera for each "display", but this will cause frustums overlapping and I have part of the image rendered twice (logically). I can use orthographic-camera, there is no overlap, but I have no perspective.

How to solve this problem?

Edit: I am using Unity 5

\$\endgroup\$
  • \$\begingroup\$ What game engine is this? \$\endgroup\$ – Sturlen Nov 11 '15 at 18:21
  • 1
    \$\begingroup\$ @ZEKE Edit added \$\endgroup\$ – Martin Perry Nov 11 '15 at 18:28
  • \$\begingroup\$ @ZEKE the game engine used is totally irrelevant in this situation, this is an issue that would arise with any engine, even if you built your game entirely with pure OpenGL calls. \$\endgroup\$ – Vaillancourt Nov 11 '15 at 18:58
  • \$\begingroup\$ Still, @Alexandre; it doesn't hurt to have a little more information to go on. \$\endgroup\$ – Sturlen Nov 11 '15 at 19:39
3
\$\begingroup\$

You can't.

Sorry.

Well you could. But it would involve a distortion mesh (basically, you render your scene to a texture, and you distort that texture with a mesh, and you display that mesh). And this would imply that your camera never changes position, or that you have a distortion mesh available for each of the camera's possible positions.

Otherwise, well, you've said it, you'll lose the perspective (because you'll use orthographic cameras).

Maybe a work around I could suggest:

Have all your cameras positioned at the same location, but shooting each a FOV of 45°, and each rotated of 45° from the previous one. You'll cover a wide angle of 180°. This way, you won't be shooting twice the same thing. Now the tricky part is to have your scene "wraped" around your cameras: you'll need a table that does a half circle, and if you move objects width-wise in the scene, you'll have to move them radially instead.

In the image, we see a top view of what I suggest; the black lines are the four fields of view, and the red shows the bent (in a half circle) rectangle long table.

idea

This would be the best if you could project onto a curved surface, and better if your could set up your four displays in a 180° fashion.

This, of course, will not solve your issue, it could only alleviate it.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thank you. I thought it wont be possible (at least not easy and accurate). Other thing that come to my mind is maybe use ortho-camera and calculate pseudo-projection for models. That way, model will be rendered once, but absed on "quadrant", different projection matrix will be used (or some interpolation between matrices) to handle transition. \$\endgroup\$ – Martin Perry Nov 11 '15 at 18:46
  • \$\begingroup\$ Draw diagrams like the one @Alexandre includes in the answer, and it can help you think about what you want to be visible from different positions. And if it will "make sense" the way you want. \$\endgroup\$ – david van brink Nov 11 '15 at 18:54
  • \$\begingroup\$ @MartinPerry If you're very knowledgeable with projection matrices, be my guest to try! But from what I've seen, though, there is no way to 'interpolate' an orthographic projection matrix to a perspective one. I would think you'd encounter a lot of issues if you mix projection matrices for the scene objects as the matrices "move" things around. I'll be eager to see what solution you come up with! \$\endgroup\$ – Vaillancourt Nov 11 '15 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.