diff --git a/orgfile.org b/orgfile.org index f0ca301..16229cc 100644 --- a/orgfile.org +++ b/orgfile.org @@ -69,6 +69,8 @@ All the code in this repository is under GPLv3, see LICENSE for more information ** DONE Heirarchical Transforms ** DONE Materials with textures - State "DONE" from "TODO" [2015-10-15 Thu 21:21] +** TODO Lights! +** TODO Fix problems with texture units ** TODO Fix problems with frustrum culling ** TODO 2d drawing routines ** TODO Gui diff --git a/src/framebuffer.c b/src/framebuffer.c index 1399f6f..d7f9e7e 100644 --- a/src/framebuffer.c +++ b/src/framebuffer.c @@ -47,12 +47,12 @@ int framebuffer_create(int width, int height, int has_depth, int has_color) glGenRenderbuffers(1, &renderbuffer); glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer); glRenderbufferStorage(GL_RENDERBUFFER, - GL_DEPTH24_STENCIL8, + GL_DEPTH_COMPONENT, width, height); renderer_check_glerror("framebuffer:create"); glFramebufferRenderbuffer(GL_FRAMEBUFFER, - GL_DEPTH_STENCIL_ATTACHMENT, + GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, renderbuffer); renderer_check_glerror("framebuffer:create"); diff --git a/src/renderer.c b/src/renderer.c index 7e2d3f4..3abd9f4 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -115,7 +115,7 @@ void renderer_init(GLFWwindow* window) texture_set_param(def_uv_tex, GL_TEXTURE_MAG_FILTER, GL_LINEAR); def_depth_tex = texture_create("def_depth_texture", - TU_SHADOWMAP1, + TU_DIFFUSE, width, height, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT32F, @@ -134,7 +134,7 @@ void renderer_init(GLFWwindow* window) framebuffer_set_texture(def_fbo, def_normal_tex, GL_COLOR_ATTACHMENT0 + 2); framebuffer_set_texture(def_fbo, def_uv_tex, GL_COLOR_ATTACHMENT0 + 3); framebuffer_set_texture(def_fbo, def_depth_tex, GL_DEPTH_ATTACHMENT); - + fbo_shader = shader_create("fbo.vert", "fbo.frag"); } @@ -197,9 +197,9 @@ void renderer_draw(void) texture_unbind(def_normal_tex); glViewport(width / 2, 0, width / 2, height / 2); - texture_bind(def_uv_tex); + texture_bind(def_depth_tex); geom_render(quad_geo); - texture_unbind(def_uv_tex); + texture_unbind(def_depth_tex); shader_unbind(); }