Always use an alpha value of 1.0 for drawing scene to texture

Fixes invisible screenshots and blank screens on certain systems
This commit is contained in:
Cacodemon345
2025-03-14 14:07:33 +06:00
parent f3a437c864
commit c166abbbc1

View File

@@ -107,6 +107,7 @@ const char* fragment_shader_default_tex_src =
"void main()\n"
"{\n"
" color = texture(Texture, texCoord);\n"
" color.a = 1.0;\n"
"}\n";
const char* vertex_shader_default_color_src =
@@ -141,6 +142,7 @@ const char* fragment_shader_default_color_src =
"void main()\n"
"{\n"
" outColor = color;\n"
" outColor.a = 1.0;\n"
"}\n";
static inline int
@@ -1667,9 +1669,6 @@ OpenGLRenderer::render()
unsigned char *rgba = (unsigned char *)calloc(1, width * height * 4);
glw.glFinish();
glw.glBindFramebuffer(GL_FRAMEBUFFER, 0);
glw.glReadBuffer(GL_BACK);
glw.glFinish();
glw.glReadPixels(window_rect.x, window_rect.y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, rgba);