mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Alpha compare should happen after the 1st cycle of a two-cycle combiner
Fixed invisible rocks in Mischief Makers intro.
This commit is contained in:
parent
8425a840ae
commit
1d1f4bdbb4
|
@ -179,13 +179,6 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo
|
|||
strFragmentShader.append(" vec_color = vec4(input_color, vShadeColor.a); \n");
|
||||
strFragmentShader.append(strCombiner);
|
||||
|
||||
strFragmentShader.append(
|
||||
" if (uEnableAlphaTest != 0) { \n"
|
||||
" lowp float alphaTestValue = (uAlphaCompareMode == 3 && alpha2 > 0.0) ? snoise() : uAlphaTestValue; \n"
|
||||
" if (alpha2 < alphaTestValue) discard; \n"
|
||||
" } \n"
|
||||
);
|
||||
|
||||
if (!g_weakGLSL) {
|
||||
strFragmentShader.append(
|
||||
" lowp int fogUsage = uFogUsage; \n"
|
||||
|
|
|
@ -330,13 +330,6 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo
|
|||
strFragmentShader.append(" vec_color = vec4(input_color, vShadeColor.a); \n");
|
||||
strFragmentShader.append(strCombiner);
|
||||
|
||||
strFragmentShader.append(
|
||||
" if (uEnableAlphaTest != 0) { \n"
|
||||
" lowp float alphaTestValue = (uAlphaCompareMode == 3 && alpha2 > 0.0) ? snoise() : uAlphaTestValue; \n"
|
||||
" if (alpha2 < alphaTestValue) discard; \n"
|
||||
" } \n"
|
||||
);
|
||||
|
||||
if (config.generalEmulation.enableNoise != 0) {
|
||||
strFragmentShader.append(
|
||||
" if (uColorDitherMode == 2) colorNoiseDither(snoise(), color2); \n"
|
||||
|
|
|
@ -235,6 +235,12 @@ int compileCombiner(Combiner & _color, Combiner & _alpha, char * _strShader)
|
|||
}
|
||||
strcpy(_strShader, " alpha1 = ");
|
||||
int nInputs = _compileCombiner(_alpha.stage[0], AlphaInput, _strShader);
|
||||
strcat(_strShader,
|
||||
" if (uEnableAlphaTest != 0) { \n"
|
||||
" lowp float alphaTestValue = (uAlphaCompareMode == 3 && alpha1 > 0.0) ? snoise() : uAlphaTestValue; \n"
|
||||
" if (alpha1 < alphaTestValue) discard; \n"
|
||||
" } \n"
|
||||
);
|
||||
strcat(_strShader, " color1 = ");
|
||||
nInputs |= _compileCombiner(_color.stage[0], ColorInput, _strShader);
|
||||
strcat(_strShader, fragment_shader_blender);
|
||||
|
|
Loading…
Reference in New Issue
Block a user