mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-17 21:08:14 +00:00
[client] egl: always render desktop texture as opaque
We ask for 32-bit colour buffer when creating the EGL context. On Wayland, this sometimes give contexts with alpha channels, resulting in unwanted transparency. So we clear the alpha channel in the desktop shader. We also switch to using constant alpha for blending the splash, which avoids more alpha issues.
This commit is contained in:
@@ -45,7 +45,6 @@ struct EGL_Splash
|
||||
EGL_Model * logo;
|
||||
|
||||
// uniforms
|
||||
GLint uBGAlpha;
|
||||
GLint uScale;
|
||||
};
|
||||
|
||||
@@ -74,8 +73,6 @@ bool egl_splash_init(EGL_Splash ** splash)
|
||||
return false;
|
||||
}
|
||||
|
||||
(*splash)->uBGAlpha = egl_shader_get_uniform_location((*splash)->bgShader, "alpha");
|
||||
|
||||
if (!egl_model_init(&(*splash)->bg))
|
||||
{
|
||||
DEBUG_ERROR("Failed to intiailize the splash bg model");
|
||||
@@ -166,14 +163,14 @@ void egl_splash_free(EGL_Splash ** splash)
|
||||
void egl_splash_render(EGL_Splash * splash, float alpha, float scaleY)
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendColor(0, 0, 0, alpha);
|
||||
glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
|
||||
|
||||
egl_shader_use(splash->bgShader);
|
||||
glUniform1f(splash->uBGAlpha, alpha);
|
||||
egl_model_render(splash->bg);
|
||||
|
||||
egl_shader_use(splash->logoShader);
|
||||
glUniform2f(splash->uScale, alpha, scaleY);
|
||||
glUniform1f(splash->uScale, scaleY);
|
||||
egl_model_render(splash->logo);
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
Reference in New Issue
Block a user