1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Correct color and alpha dithering.

Fixed regression in Zelda MM motion blur, introduced in commit 25c04829.
This commit is contained in:
Sergey Lipskiy 2014-05-16 10:53:16 +07:00
parent a3f9fe2186
commit 28a1d19458
2 changed files with 16 additions and 2 deletions

View File

@ -399,8 +399,8 @@ GLSLCombiner::GLSLCombiner(Combiner *_color, Combiner *_alpha) {
strcat(fragment_shader, " input_color = vShadeColor.rgb;\n");
strcat(fragment_shader, " vec_color = vec4(input_color, vShadeColor.a); \n");
strcat(fragment_shader, strCombiner);
strcat(fragment_shader, " if (uColorDitherMode == 2) color2 *= clamp(snoise(vNoiseCoord2D), 0.0, 1.0);");
// strcat(fragment_shader, " if (uAlphaDitherMode == 2) alpha2 *= clamp(snoise(vNoiseCoord2D), 0.0, 1.0);");
strcat(fragment_shader, fragment_shader_color_dither);
strcat(fragment_shader, fragment_shader_alpha_dither);
strcat(fragment_shader, " gl_FragColor = vec4(color2, alpha2); \n");

View File

@ -329,6 +329,20 @@ static const char* fragment_shader_header_main =
;
#endif
static const char* fragment_shader_color_dither =
" if (uColorDitherMode == 2) { \n"
" color2 += 0.03125*snoise(vNoiseCoord2D); \n"
" color2 = clamp(color2, 0.0, 1.0); \n"
" } \n"
;
static const char* fragment_shader_alpha_dither =
" if (uAlphaDitherMode == 2) { \n"
" alpha2 += 0.03125*snoise(vNoiseCoord2D); \n"
" alpha2 = clamp(alpha2, 0.0, 1.0); \n"
" } \n"
;
#ifdef USE_TOONIFY
static const char* fragment_shader_toonify =
" \n"