mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-26 01:40:24 +00:00
Double alpha at least for a known case.
Makes Popolocrois look much better now.
This commit is contained in:
parent
bc1e0d09d4
commit
8f27d03af3
@ -86,6 +86,7 @@ void ComputeFragmentShaderID(FragmentShaderID *id) {
|
||||
bool enableAlphaTest = gstate.isAlphaTestEnabled() && !IsAlphaTestTriviallyTrue();
|
||||
bool enableColorTest = gstate.isColorTestEnabled() && !IsColorTestTriviallyTrue();
|
||||
bool enableColorDoubling = (gstate.texfunc & 0x10000) != 0;
|
||||
bool enableAlphaDoubling = gstate.getBlendFuncA() == GE_SRCBLEND_DOUBLESRCALPHA || gstate.getBlendFuncB() == GE_DSTBLEND_DOUBLESRCALPHA;
|
||||
bool doTextureProjection = gstate.getUVGenMode() == 1;
|
||||
|
||||
// id->d[0] |= (gstate.clearmode & 1);
|
||||
@ -105,6 +106,7 @@ void ComputeFragmentShaderID(FragmentShaderID *id) {
|
||||
id->d[0] |= (enableFog & 1) << 15;
|
||||
id->d[0] |= (doTextureProjection & 1) << 16;
|
||||
id->d[0] |= (enableColorDoubling & 1) << 17;
|
||||
id->d[0] |= (enableAlphaDoubling & 1) << 18;
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,6 +127,8 @@ void GenerateFragmentShader(char *buffer) {
|
||||
bool enableAlphaTest = gstate.isAlphaTestEnabled() && !IsAlphaTestTriviallyTrue() && !gstate.isModeClear();
|
||||
bool enableColorTest = gstate.isColorTestEnabled() && !IsColorTestTriviallyTrue() && !gstate.isModeClear();
|
||||
bool enableColorDoubling = (gstate.texfunc & 0x10000) != 0;
|
||||
// TODO: This only does one of the four possible modes.
|
||||
bool enableAlphaDoubling = gstate.getBlendFuncA() == GE_SRCBLEND_DOUBLESRCALPHA || gstate.getBlendFuncB() == GE_DSTBLEND_DOUBLESRCALPHA;
|
||||
bool doTextureProjection = gstate.getUVGenMode() == 1;
|
||||
|
||||
if (doTexture)
|
||||
@ -233,6 +237,10 @@ void GenerateFragmentShader(char *buffer) {
|
||||
WRITE(p, " if (v.a %s u_alphacolorref.a) discard;\n", alphaTestFuncs[alphaTestFunc]);
|
||||
}
|
||||
}
|
||||
|
||||
if (enableAlphaDoubling) {
|
||||
WRITE(p, " v.a = v.a * 2.0;\n");
|
||||
}
|
||||
|
||||
if (enableColorTest) {
|
||||
int colorTestFunc = gstate.colortest & 3;
|
||||
|
Loading…
Reference in New Issue
Block a user