Problem using Fbo larger than Window

Hi everyone, a Cinder noobie is here

so as the title suggests, I’m having problems using FBO larger than window size

    #define SIZE 1024 // this is also the size of created buffer
    buffer->bindFramebuffer();
    ci::gl::ScopedMatrices scp2;
    ci::gl::viewport(0,0,SIZE,SIZE);
    ci::gl::clear();
    ci::gl::translate(SIZE/2.0F,SIZE/2.0F);
    // draw something here
    buffer->unbindFramebuffer();
    ci::writeImage("output.png",buffer->getColorTexture()->createSource());

let’s say my monitor resolution is 1366 x 768, as a result output.png is always corrupted
I assume it’s something regarding viewport or scissor, but I can’t get it to work

But if I set SIZE to for example 512, it works as intended

Your matrices will be wrong. Add a gl::setMatricesWindow ( SIZE, SIZE ); before you draw (assuming you’re drawing in 2D)

1 Like

It’s working, thank you so much