-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image Export generates black image #415
Comments
The bug is likely related to this function: solvespace/src/render/rendergl3.cpp Lines 681 to 687 in c18deb2
On Windows, ANGLE is used, which might have some issue with |
Following the lead from this SO answer, I applied the following patch: diff --git a/src/render/rendergl3.cpp b/src/render/rendergl3.cpp
index 167ce03..cc21130 100644
--- a/src/render/rendergl3.cpp
+++ b/src/render/rendergl3.cpp
@@ -5,6 +5,7 @@
//-----------------------------------------------------------------------------
#include "solvespace.h"
#include "gl3shader.h"
+#include <fstream>
namespace SolveSpace {
@@ -679,10 +680,25 @@ void OpenGl3Renderer::Clear() {
}
std::shared_ptr<Pixmap> OpenGl3Renderer::ReadFrame() {
+ std::ofstream err("t:/solvespace-err.log");
+ err << std::hex;
+
std::shared_ptr<Pixmap> pixmap =
Pixmap::Create(Pixmap::Format::RGB, (size_t)camera.width, (size_t)camera.height);
+
+ err << "pregl\n";
+ for(GLenum e; (e = glGetError()) != GL_NO_ERROR;) {
+ err << e << '\n';
+ }
+
glReadPixels(0, 0, (int)camera.width, (int)camera.height,
GL_RGB, GL_UNSIGNED_BYTE, &pixmap->data[0]);
+
+ err << "postgl\n";
+ for(GLenum e; (e = glGetError()) != GL_NO_ERROR;) {
+ err << e << '\n';
+ }
+
return pixmap;
} And, after Exporting Image, the contents of
Which this says is Sadly, I don't really do GL et al. so I don't know where to follow with this. |
From the OpenGL ES 2 doc:
|
I believe this is fixed in 11c5cdc. Can you check? |
Very nice! |
System information
SolveSpace version: 3.0~62aba398
Operating system: Windows 10
Expected behavior
The File -> Export Image… menu item, after confirming location, exports the visible geometry.
Actual behavior
The output file has the correct size, but contains only black.
Additional information
Works on 2.3.
Doesn't depend on the contents of the sketch.
The text was updated successfully, but these errors were encountered: