Created
September 12, 2009 12:49
-
-
Save andsve/185826 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void draw_geometry_pass(void) | |
{ | |
glViewport(0,0,window_width,window_hight); | |
camera->updateProjection(); | |
camera->updateModelview(); | |
// Get projection matrix, and create inverse for DF pass 2. | |
glGetFloatv(GL_MODELVIEW_MATRIX, matrix_modelview); | |
glGetFloatv(GL_PROJECTION_MATRIX, matrix_projection); | |
helper_MatrixInv(matrix_projection_inverse, matrix_projection); | |
helper_MatrixInv(matrix_modelview_inverse, matrix_modelview); | |
// Bind MRT FBO | |
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, render_fbo); | |
glDrawBuffers(4, render_targets); | |
// Clear and reset translations | |
glClear(GL_DEPTH_BUFFER_BIT); | |
glColor3f(1,1,1); | |
glEnable(GL_COLOR_MATERIAL); | |
// DF Pass 1 | |
// Depth and normals | |
shader_df_pass1->bind(); | |
draw_scene(); | |
// Pass 1 done | |
shader_df_pass1->unbind(); | |
// Unbind MRT FBO | |
//glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment