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:
parent
a3f9fe2186
commit
28a1d19458
|
@ -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");
|
||||
|
||||
|
|
14
Shaders.h
14
Shaders.h
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user