nannou-org / nannou

A Creative Coding Framework for Rust.
https://nannou.cc/
6.05k stars 306 forks source link

Is it possible to render with a lower resolution within a higher resolution container/window? #926

Open felixriehm opened 1 year ago

felixriehm commented 1 year ago

Because of performance issues i would like to render a 2D scene (animated circles, lines, text, etc) with a lower resolution within a higher resolution window. Of course, the rendered images than would be stretched by some kind of interpolation to the higher resolution of the window. For example, i like to render my scene in 1080p and than stretch the rendered image to a 4k window. Is there a way to do that with nannou?

johannesvollmer commented 10 months ago

You could render into a low-res texture, and then draw that to the screen.

Have a look at the high-res capture example, you might be able to do the opposite (render to smaller texture). See #947 for an extracted version of that code.