# Disable alpha channel for FBO

**URL:** <https://discourse.libcinder.org/t/disable-alpha-channel-for-fbo/154>\
**Category:** Using Cinder\
**Created:** [July 13, 2016, 6:01am UTC](https://discourse.libcinder.org/t/disable-alpha-channel-for-fbo/154 "2016-07-13T06:01:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabor\_papp](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gabor_papp/32/769_2.png) [@gabor\_papp](https://discourse.libcinder.org/u/gabor_papp)\
**Post date:** [July 13, 2016, 6:01am UTC](https://discourse.libcinder.org/t/disable-alpha-channel-for-fbo/154/1 "2016-07-13T06:01:55Z")

</div>

As we transition to Discourse, this is a response in reply to [this post](https://forum.libcinder.org/#Topic/23286000002704029) made in the old Zoho forum.

Although I’m not familiar with WebGL, I think you are right about `preserveDrawingBuffer`. If it is true, you don’t call `gl::clear`, otherwise you do.

About creating an `gl::Fbo` without alpha, there are many ways to do this:

- use the [`gl::Fbo::create( int width, int height, bool alpha, bool depth, bool stencil)`](https://github.com/cinder/Cinder/blob/master/include/cinder/gl/Fbo.h#L105) method

- use `gl::Fbo::Format`  
`gl::Fbo::Format fboFormat; fboFormat.colorTexture( gl::Fbo::Format::getDefaultColorTextureFormat( false ) ); mFbo = gl::Fbo::create( width, height, fboFormat );`

- or you cen set the color texture internal format  
`gl::Texture2d::Format colorTextureFormat; colorTextureFormat.internalFormat( GL_RGB ); gl::Fbo::Format fboFormat; fboFormat.colorTexture( colorTextureFormat ); mFbo = gl::Fbo::create( width, height, fboFormat );`

---

<div class="post-metadata">

**Author:** ![couleurs](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/couleurs/32/99_2.png) [@couleurs](https://discourse.libcinder.org/u/couleurs)\
**Post date:** [July 13, 2016, 7:03am UTC](https://discourse.libcinder.org/t/disable-alpha-channel-for-fbo/154/2 "2016-07-13T07:03:30Z")

</div>

Thanks a lot for transitioning the post to the new system and answering 🙂

Makes sense I’ll try that. I can see how that will work to customize an Fbo I create myself but is there a way to customize the Fbo that is “automatically” created for the final drawing to screen? Or do I have to create my own customized, draw the final scene into it, and then use that Fbo for the final drawing to screen?

Thanks so much!

---

<div class="post-metadata">

**Author:** ![sansumbrella](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/sansumbrella/32/30_2.png) [@sansumbrella](https://discourse.libcinder.org/u/sansumbrella)\
**Post date:** [July 13, 2016, 7:56pm UTC](https://discourse.libcinder.org/t/disable-alpha-channel-for-fbo/154/3 "2016-07-13T19:56:24Z")

</div>

On desktop platforms the screen buffer generally isn’t an FBO (though it is on some mobile platforms, like iOS). As such, it doesn’t meaningfully have alpha regardless, since it is never blended into another drawing buffer.

If you want to draw without alpha blending, you can disable blending:

```auto
gl::ScopedBlend blend(false);
… // draw opaque things

```

For a long time, alpha was disabled by default in Cinder. Recent versions switched to having alpha enabled by default with the aim of making it more accessible to new users.

You can use the DST\_ALPHA in a blend equation, giving purpose to the destination buffer’s alpha channel, but I don’t know what use cases it has. The common factors are `(1.0, 1.0 - source_alpha)` for premultiplied alpha, and `(source_alpha, 1.0 - source_alpha)` for non-premultiplied alpha.
