no more pixel interpolation in viewport, meaning sharp pixel edges for low-resolution-images, not only after rendering, but visible in viewport.

This commit is contained in:
2022-07-16 11:37:38 +02:00
parent adf84a3716
commit 2209ad70f2

View File

@@ -80,17 +80,18 @@ void draw() {
background(color(0));
imageMode(CENTER);
renderer.noSmooth();
viewport = renderer.get();
int imgw, imgh;
if (renderer.width < renderer.height) {
viewport.resize(0, height);
if (viewport.width > width) viewport.resize(width, 0);
imgh = (int)height;
imgw = int((float(renderer.width)/float(renderer.height))*height);
} else {
viewport.resize(width, 0);
if (viewport.height > height) viewport.resize(0, height);
imgw = (int)width;
imgh = int((float(renderer.height)/float(renderer.width))*width);
}
//sourceManager.setSource();
image(viewport, width/2, height/2);
image(viewport, width/2, height/2, imgw, imgh);
if (videoRecord) {
videoExport.saveFrame();