2
\$\begingroup\$

I am using glViewport() to render a 1024x1024 shadow depth buffer for a game that is using a 1000x600 game window. Under normal circumstances it works fine, however when I am running Bandicam to monitor the FPS of the game, it seems to crop the buffer by the ratio of the window's resolution to the buffer's resolution. All of the other buffers are unaffected and the shadow depth buffer is the only one that relies on glViewport() so I believe it has something to do with glViewport(). Any suggestions as to what might be going on are appreciated.

What the shadow depth map looks like normally: enter image description here

What the shadow depth map looks like when Bandicam is running: enter image description here

Some of the code related to the shadow depth buffer:

create_and_bind_framebuffer(&shadow_depth_map_framebuffer);
create_buffer(&shadow_depth_map_depth_buffer, GL_DEPTH_ATTACHMENT, SHADOW_RESOLUTION,
    SHADOW_RESOLUTION, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_LINEAR, GL_REPEAT);
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);

...

glViewport(0, 0, SHADOW_RESOLUTION, SHADOW_RESOLUTION);
glBindFramebuffer(GL_FRAMEBUFFER, shadow_depth_map_framebuffer);
shadow_depth_shader.use();
glUniformMatrix4fv(shadow_depth_shader_light_space_uniform, 1, GL_FALSE, glm::value_ptr(light_space));

glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glDrawElementsInstanced(GL_TRIANGLES, static_cast<GLsizei>(m_mesh->indices.size()),
    GL_UNSIGNED_INT, nullptr, static_cast<GLsizei>(m_instances));
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glBindVertexArray(NULL);
glUseProgram(NULL);

...

glViewport(0, 0, Window::get_size().x, Window::get_size().y);
\$\endgroup\$
2
\$\begingroup\$

If it's only happening with Bandicam then the problem is with Bandicam, not your own software. Make sure you start Bandicam before you start the application you want to record. Also, in Bandicam's video settings, uncheck "Use enhanced capture method. (DirectX only)"

\$\endgroup\$
  • \$\begingroup\$ I've made sure to do both those things and the problem remains, so I've let bandicam know of the issue. Thanks. \$\endgroup\$ – SelymAI Dec 18 '15 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.