Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayCamera: bounds vs viewport #16361

Closed
fernandojsg opened this issue Apr 30, 2019 · 1 comment
Closed

ArrayCamera: bounds vs viewport #16361

fernandojsg opened this issue Apr 30, 2019 · 1 comment

Comments

@fernandojsg
Copy link
Collaborator

On the ArrayCamera documentation currently we can read the following requirement:
https://github.com/mrdoob/three.js/blob/dev/docs/api/en/cameras/ArrayCamera.html#L17

It's mandatory to define for each sub camera the *bounds* property which determines the part of the viewport that is rendered with this camera.

But I just noticed that the webgl_array_camera example has changed from using bounds to viewport:
7a4c962#diff-4922b91cfbe857ae22c8196e08f64f00L40

While on WebVRManager we still use bounds to define each camera's viewport:
https://github.com/mrdoob/three.js/blob/dev/src/renderers/webvr/WebVRManager.js#L45-L49

I believe bounds is usually a better option as it could let us easily adapt the real viewport size when resizing the window or when changing between different RenderTargets (as we do on WebVR or when using Multiview FBOs).

@mrdoob do you mind clarifying this, if both options should be supported, or are you switching to use just one of them? Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Apr 30, 2019

As far as I remember... I added implemented bounds mainly influenced by the WebVR API. Then the WebXR API decided to provide absolute coordinates and that made me add viewport.

I agree that bounds is nicer conceptually. However, the benefit of viewport is that we can control at a pixel level every view. With bounds there were always gaps in-between views:

Screen Shot 2019-04-30 at 11 01 42 AM

https://raw.githack.com/mrdoob/three.js/r90/examples/#webgl_camera_array

So I was hoping to switch to viewport only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants