Skip to content

Instantly share code, notes, and snippets.

@grahamsellers
grahamsellers / gist:7945239
Created December 13, 2013 14:39
Set up a 10 layer FBO with depth + RGBA8_UNORM color.
GLuint tex[2];
GLuint fbo;
glGenTextures(2, tex);
glBindTexture(GL_TEXTURE_2D_ARRAY, tex[0]);
glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_DEPTH_COMPONENT32F, 1024, 1024, 10);
glBindTexture(GL_TEXTURE_2D_ARRAY, tex[1]);
glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_RGBA8, 1024, 1024, 10);
Option 1: WHAT WE HAVE TODAY
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
// Blah
glDisable(GL_DEPTH_TEST);
Option 2: ONE ENTRY POINT, EXTRA PARAMETER