mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
I'm back, after two weeks pure work and nothing of dolphin, take a look at the code and discover this very small fix, apply color clamping before alpha test, the way is done in the software plugin, have some nice effects, this will fix some things and brake others but the feedback is needed.
if you want to know where to start testing look at SMS :) HAPPY 2010 for everyone git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4775 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
f3f7ce1be6
commit
ded7a2921d
@ -537,6 +537,7 @@ const char *GeneratePixelShader(u32 texture_mask, bool dstAlphaEnable, u32 HLSL)
|
||||
}
|
||||
|
||||
WRITE(p, "depth = zCoord;\n");
|
||||
WRITE(p, "prev = saturate(prev);\n");
|
||||
|
||||
//if (bpmem.genMode.numindstages ) WRITE(p, "prev.rg = indtex0.xy;\nprev.b = 0;\n");
|
||||
|
||||
@ -733,7 +734,7 @@ static void WriteStage(char *&p, int n, u32 texture_mask, u32 HLSL)
|
||||
// combine the color channel
|
||||
if (cc.bias != 3) // if not compare
|
||||
{
|
||||
//normal color combiner goes here
|
||||
//normal color combiner goes here
|
||||
if (cc.shift>0)
|
||||
WRITE(p, " %s*(%s%s",tevScaleTable[cc.shift],tevCInputTable[cc.d],tevOpTable[cc.op]);
|
||||
else
|
||||
@ -775,7 +776,7 @@ static void WriteStage(char *&p, int n, u32 texture_mask, u32 HLSL)
|
||||
|
||||
if (ac.bias != 3) // if not compare
|
||||
{
|
||||
//normal alpha combiner goes here
|
||||
//normal alpha combiner goes here
|
||||
if (ac.shift>0)
|
||||
WRITE(p, " %s*(%s%s",tevScaleTable[ac.shift],tevAInputTable[ac.d],tevOpTable[ac.op]);
|
||||
else
|
||||
@ -853,17 +854,15 @@ void SampleTexture(char *&p, const char *destination, const char *texcoords, con
|
||||
static const char *tevAlphaFuncsTable[] =
|
||||
{
|
||||
"(false)", //ALPHACMP_NEVER 0
|
||||
"(prev.a < %s - (1.0f/510.0f))", //ALPHACMP_LESS 1
|
||||
"(prev.a < %s - (0.5f/255.0f))", //ALPHACMP_LESS 1
|
||||
"(abs( prev.a - %s ) < (1.0f/255.0f))", //ALPHACMP_EQUAL 2
|
||||
"(prev.a < %s + (1.0f/510.0f))", //ALPHACMP_LEQUAL 3
|
||||
"(prev.a > %s + (1.0f/510.0f))", //ALPHACMP_GREATER 4
|
||||
"(prev.a < %s + (0.5f/255.0f))", //ALPHACMP_LEQUAL 3
|
||||
"(prev.a > %s + (0.5f/255.0f))", //ALPHACMP_GREATER 4
|
||||
"(abs( prev.a - %s ) > (1.0f/255.0f))", //ALPHACMP_NEQUAL 5
|
||||
"(prev.a > %s - (1.0f/510.0f))", //ALPHACMP_GEQUAL 6
|
||||
"(prev.a > %s - (0.5f/255.0f))", //ALPHACMP_GEQUAL 6
|
||||
"(true)" //ALPHACMP_ALWAYS 7
|
||||
};
|
||||
|
||||
|
||||
|
||||
static const char *tevAlphaFunclogicTable[] =
|
||||
{
|
||||
" && ", // and
|
||||
|
Loading…
x
Reference in New Issue
Block a user