framebuffer: Support texture based depth buffers

This commit introduces some new framebuffer api to be able to
enable texture based depth buffers for a framebuffer (currently
only supported for offscreen framebuffers) and once allocated
to be able to retrieve the depth buffer as a texture for further
usage, say, to implement shadow mapping.

The API works as follow:
  * Before the framebuffer is allocated, you can request that a depth
    texture is created with
    cogl_framebuffer_set_depth_texture_enabled()
  * cogl_framebuffer_get_depth_texture() can then be used to grab a
    CoglTexture once the framebuffer has been allocated.
This commit is contained in:
Damien Lespiau
2012-05-23 18:19:29 +01:00
committed by Robert Bragg
parent 58bbf8499a
commit 87bc616d34
11 changed files with 319 additions and 15 deletions

View File

@@ -109,6 +109,12 @@ struct {
"GLES2 API integration supported",
"Support for creating a GLES2 context for using the GLES2 API in a "
"way that's integrated with Cogl."
},
{
COGL_FEATURE_ID_DEPTH_TEXTURE,
"Depth Textures",
"CoglFramebuffers can be configured to render their depth buffer into "
"a texture"
}
};