#How do I render a game in lower resolution and then upscale it to fit the window dimensions?

11 messages · Page 1 of 1 (latest)

hazy vigil
#

Right now I'm messing around with code from the render_to_texture example, I've changed it so that it instead renders the inner cube to a sprite and that sprite's seen through a Camera2d, but I'm struggling with getting the Camera3d for the first pass to match the dimensions of the window, it just squashes the view instead

#

Changing ViewPort::physical_size doesn't seem to change that

#

Oh! Changing Transform::scale to my resolution ratio worked!

#

Neat!

#

Well that gets the ratio right but I'm not entirely sure how big the actual camera is CalliDerp

#

It's definitely upscaling it somewhat though

#

Actually I think I should be changing the camera projection instead

#

OHHH It's in the Image I generate

icy wave
#

hi, would you be able to clarify how you solved this? am myself looking into how you are supposed to upscale in bevy

hazy vigil
#

Basically I modified the render_to_texture example to instead render to a sprite covering the entire window resolution with a 2d camera as the main pass camera

#

But I'm not a fan of this approach because it breaks mouse picking into the game world