i trying basic shadow map reason doesn't render properly. video of problem i render house using flat shader: int shadowmapwidth = window_size_x * (int)shadow_map_ratio; int shadowmapheight = window_size_y * (int)shadow_map_ratio; // rendering shadow texture. glactivetexture(gl_texture0); call_gl(glbindtexture(gl_texture_2d, shadowtexture)); // bind framebuffer. call_gl(glbindframebuffer(gl_framebuffer, shadowfbo)); //clear call_gl(glclear(gl_depth_buffer_bit)); call_gl(glviewport(0, 0, shadowmapwidth, shadowmapheight)); call_gl(glcolormask(gl_false, gl_false, gl_false, gl_false)); //render stuff flatshader.use(); flatshader["basecolor"] = glm::vec4(1.0f,1.0f,1.0f,1.0f); flatshader["pvm"] = projectionmatrix*pointlight.viewmatrix*cursor.modelmatrix; cursor.draw(); //binds vao , draws // revert scene. call_gl(glbindframebuffer(gl_framebuffer, 0)); call_gl(glcolormask(gl_true, gl_true, gl_true, gl_true)); call_gl(glviewport(0, 0, window_size_x, window_s
Comments
Post a Comment