# Problem using Fbo larger than Window

**URL:** <https://discourse.libcinder.org/t/problem-using-fbo-larger-than-window/1924>\
**Category:** Using Cinder\
**Created:** [February 13, 2022, 7:29pm UTC](https://discourse.libcinder.org/t/problem-using-fbo-larger-than-window/1924 "2022-02-13T19:29:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rasoolZero](https://avatars.discourse-cdn.com/v4/letter/r/bcef8e/32.png) [@rasoolZero](https://discourse.libcinder.org/u/rasoolZero)\
**Post date:** [February 13, 2022, 7:29pm UTC](https://discourse.libcinder.org/t/problem-using-fbo-larger-than-window/1924/1 "2022-02-13T19:29:45Z")

</div>

Hi everyone, a Cinder noobie is here

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

```auto
    #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

 ![Fade-180](https://canada1.discourse-cdn.com/flex030/uploads/libcinder/original/1X/88a98fd4d54a3dc5786f3e11ade56b1789c876d9.jpeg)

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

---

<div class="post-metadata">

**Author:** ![lithium](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/lithium/32/38_2.png) [@lithium](https://discourse.libcinder.org/u/lithium)\
**Post date:** [February 14, 2022, 5:32am UTC](https://discourse.libcinder.org/t/problem-using-fbo-larger-than-window/1924/2 "2022-02-14T05:32:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rasoolZero](https://avatars.discourse-cdn.com/v4/letter/r/bcef8e/32.png) [@rasoolZero](https://discourse.libcinder.org/u/rasoolZero)\
**Post date:** [February 14, 2022, 9:47am UTC](https://discourse.libcinder.org/t/problem-using-fbo-larger-than-window/1924/3 "2022-02-14T09:47:55Z")

</div>

It’s working, thank you so much
