Skip to content
Snippets Groups Projects
Commit 4f9104a8 authored by Thomas Müller's avatar Thomas Müller
Browse files

Fix single-frame lag of `testbed.screenshot()`

parent 34056f8e
No related branches found
No related tags found
No related merge requests found
...@@ -208,6 +208,7 @@ py::array_t<float> Testbed::render_to_cpu(int width, int height, int spp, bool l ...@@ -208,6 +208,7 @@ py::array_t<float> Testbed::render_to_cpu(int width, int height, int spp, bool l
#ifdef NGP_GUI #ifdef NGP_GUI
py::array_t<float> Testbed::screenshot(bool linear) const { py::array_t<float> Testbed::screenshot(bool linear) const {
std::vector<float> tmp(m_window_res.prod() * 4); std::vector<float> tmp(m_window_res.prod() * 4);
glReadBuffer(GL_FRONT);
glReadPixels(0, 0, m_window_res.x(), m_window_res.y(), GL_RGBA, GL_FLOAT, tmp.data()); glReadPixels(0, 0, m_window_res.x(), m_window_res.y(), GL_RGBA, GL_FLOAT, tmp.data());
py::array_t<float> result({m_window_res.y(), m_window_res.x(), 4}); py::array_t<float> result({m_window_res.y(), m_window_res.x(), 4});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment