# FBO Format: Depth Texture vs. Depth Buffer

**URL:** <https://discourse.libcinder.org/t/fbo-format-depth-texture-vs-depth-buffer/492>\
**Category:** Uncategorized\
**Created:** [January 7, 2017, 11:11pm UTC](https://discourse.libcinder.org/t/fbo-format-depth-texture-vs-depth-buffer/492 "2017-01-07T23:11:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![parsaiej](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@parsaiej](https://discourse.libcinder.org/u/parsaiej)\
**Post date:** [January 7, 2017, 11:11pm UTC](https://discourse.libcinder.org/t/fbo-format-depth-texture-vs-depth-buffer/492/1 "2017-01-07T23:11:30Z")

</div>

Hi! I will be using FBOs because I want to implement Nvidia’s [PCSS](http://developer.download.nvidia.com/shaderlibrary/docs/shadow_PCSS.pdf), and will need to format it in such a way that I can render depth. As shown below in the docs, I noticed that FBOs can be formatted as a depth _buffer_ as well as a depth _texture_. What is the difference, and which one should I use for shadow mapping? Cheers!

 ![](https://canada1.discourse-cdn.com/flex030/uploads/libcinder/original/1X/572859a9273dbc98af99cf5d6908783b2f2bb819.png)

---

<div class="post-metadata">

**Author:** ![vinjn](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/vinjn/32/44_2.png) [@vinjn](https://discourse.libcinder.org/u/vinjn)\
**Post date:** [January 8, 2017, 2:21am UTC](https://discourse.libcinder.org/t/fbo-format-depth-texture-vs-depth-buffer/492/2 "2017-01-08T02:21:40Z")

</div>

If you want to use the rendered result as a texture, then use `depthTexture()`

---

<div class="post-metadata">

**Author:** ![sharkbox](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/sharkbox/32/39_2.png) [@sharkbox](https://discourse.libcinder.org/u/sharkbox)\
**Post date:** [January 9, 2017, 3:43pm UTC](https://discourse.libcinder.org/t/fbo-format-depth-texture-vs-depth-buffer/492/3 "2017-01-09T15:43:23Z")

</div>

You’d definitely want the depth texture as in PCSS you’re going to want to sample the depth buffer which you’ll most likely do as a depth texture in the shader. Check out the ShadowMappingBasic sample that ships with cinder, it might provide a good base to start from.
