#SubViewport upscale per canvas_items stretch settings

2 messages · Page 1 of 1 (latest)

leaden sage
#

Hello,

Anyone know how to get a SubViewport to stretch and upcale with the screen resolution, much like the 'canvas_items' stretch mode for the project settings?

Per Image 1 -
I tried setting the SubViewportContainer to 'stretch' but that seems to simply resize the container and not the contents.
Setting the SubViewport size to my original resolution of 320x180 and then Size 2D override to what I want it upscaled to, i.e. 1920x1080, for some reason makes the viewport render very small and pixelated.

Per Image 2 -
Doing the opposite and setting the SubViewport size to 1920x1080, and the Size 2D override to 320x180 performs the needed upscaling, but then the scene is outside of my window and I can't resize/scale it down it to fit.

Basically just want to upscale the scene in the SubViewport just as 'canvas_items' would if the scene was outside of the SubViewport.

Any help is greatly appreciated!

leaden sage
#

That makes sense, thank you for explaining it that way! Does that mean you generally want Size 2D Override to be smaller than the 'Size' parameters?
My project settings are pretty simple as pictured.

If I leave the 'Size' at 320 x 180 per the picture in my first post and scale the window it does scale the viewport with it, but the viewport is still 'pixelated' and doesn't upscale the contents.

Pictures 4 and 5 show the difference.
In picture 4 I put the nodes outside of the SubViewport and resize the window to full screen. Can see it upscaled and everything is crisp as intended.
Picture 5 is when the nodes are inside of the SubViewport and the window is resized to full screen. It stretches the content but it doesn't upscale it, everything remains pixelated.