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

Disable noise emulation if enableNoise option is off.

This commit is contained in:
Sergey Lipskiy 2015-02-25 20:26:17 +06:00
parent 46e6f3c28c
commit 4faa52e76d
2 changed files with 18 additions and 3 deletions

View File

@ -542,8 +542,11 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo
strFragmentShader.append(" input_color = vShadeColor.rgb;\n");
strFragmentShader.append(" vec_color = vec4(input_color, vShadeColor.a); \n");
strFragmentShader.append(strCombiner);
strFragmentShader.append(fragment_shader_color_dither);
strFragmentShader.append(fragment_shader_alpha_dither);
if (config.generalEmulation.enableNoise != 0) {
strFragmentShader.append(fragment_shader_color_dither);
strFragmentShader.append(fragment_shader_alpha_dither);
}
strFragmentShader.append(
" if (!alpha_test(alpha2)) discard; \n"
@ -578,6 +581,9 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo
strFragmentShader.append(fragment_shader_end);
if (config.generalEmulation.enableNoise == 0)
strFragmentShader.append(fragment_shader_dummy_noise);
#ifdef USE_TOONIFY
strFragmentShader.append(fragment_shader_toonify);
#endif
@ -610,7 +616,8 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo
glAttachShader(m_program, g_test_alpha_shader_object);
if (video().getRender().isImageTexturesSupported() && config.frameBufferEmulation.N64DepthCompare != 0)
glAttachShader(m_program, g_calc_depth_shader_object);
glAttachShader(m_program, g_calc_noise_shader_object);
if (config.generalEmulation.enableNoise != 0)
glAttachShader(m_program, g_calc_noise_shader_object);
#endif
glLinkProgram(m_program);
assert(checkProgramLinkStatus(m_program));

View File

@ -539,6 +539,14 @@ static const char* fragment_shader_noise =
"} \n"
;
static const char* fragment_shader_dummy_noise =
" \n"
"lowp float snoise() \n"
"{ \n"
" return 1.0; \n"
"} \n"
;
#ifdef GL_IMAGE_TEXTURES_SUPPORT
static const char* depth_compare_shader_float =
"#version 430 \n"