-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Correctly calculate GLViewport with Framebuffer #6553
Conversation
If I understand this approach correctly, it expects the application to calculate and pass a The canvas's aspect ratio is never wrong because we base the dimensions of I think it would be more robust to take the dimensions of the canvas and "stretch to fit" into the dimensions of the external framebuffer. |
fd0c04f
to
090faf0
Compare
This does work for a external framebuffer as the dimensions (and thus aspect) are based on the The I think it is reasonable to expect that the following works const target = new Framebuffer(gl, {width, height});
const viewport = new WebMercatorViewport({width, height});
deck.deckRenderer.renderLayers({
target,
viewports: [viewport],
moduleParameters: {devicePixelRatio: 1},
...
});
I can see that the stretch-to-fit approach would work for the case of rendering the current canvas into a framebuffer, but if I just want to render a fixed view into a fixed framebuffer why should this be dependent on the canvas pixel ratio & size? Does this make sense? Perhaps I'm misunderstanding what you mean by "stretch-to-fit"? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it makes sense. Thank you for the clarification.
For #6552
Background
When passing a
Framebuffer
as atarget
the GLViewport calculated assumed the width and height to be equal to the GL canvasChange List
moduleParameters
specify a pixel ratio, respect this when calculating the GL viewport