Skip to content

Commit

Permalink
Fix splash screen logo alpha blending issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Juppi88 committed Aug 6, 2019
1 parent e64c991 commit 2ea7e8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions mylly/renderer/opengl/defaultshaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ const char *splash_shader_source =
"\n"
"void main()\n"
"{\n"
" vec4 colour = texture2D(Texture, texCoord);\n"
" vec4 texColour = texture2D(Texture, texCoord);\n"
"\n"
" if (colour.a < 0.01) { discard; }\n"
" if (texColour.a < 0.01) { discard; }\n"
"\n"
" vec3 outColour = (1.0 - Colour.a) * Colour.rgb + Colour.a * colour.rgb;\n"
" vec3 outColour = (1.0 - texColour.a) * Colour.rgb + texColour.a * texColour.rgb;\n"
" outColour = (1.0 - Colour.a) * Colour.rgb + Colour.a * outColour.rgb;\n"
" gl_FragColor = vec4(outColour, 1);\n"
"}\n"
"\n"
Expand Down
2 changes: 1 addition & 1 deletion mylly/renderer/splashscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static shader_t *shader = NULL; // Shader which is used to render the splash scr
static colour_t colour = { .r = 0, .g = 0, .b = 0, .a = 255 }; // Splash screen background colour
static uint64_t display_time = 0; // Time when the splash screen is displayed.

static const int SPLASH_MIN_DURATION = 500;
static const int SPLASH_MIN_DURATION = 750;
static const int SPLASH_FADE_TIME = 500;

// -------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 2ea7e8c

Please sign in to comment.