mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Partially revert commit 81cc0854
Fix blending when CLR_ON_CVG flag is on.
It will not work without pixel covarage calculation. Fixed Mario Tennis (USA) - missing character selection icons (regression) #1599 Fixed Android/potential PC regression too: Conker broken FB render/lighting chunks. #1597
This commit is contained in:
parent
1ab3836443
commit
ee3f4a6962
|
@ -480,13 +480,8 @@ public:
|
||||||
" lowp vec4 blend1 = (muxpm0 * muxa) + (muxpm2 * muxb); \n"
|
" lowp vec4 blend1 = (muxpm0 * muxa) + (muxpm2 * muxb); \n"
|
||||||
" clampedColor.rgb = clamp(blend1.rgb, 0.0, 1.0); \n"
|
" clampedColor.rgb = clamp(blend1.rgb, 0.0, 1.0); \n"
|
||||||
" } else { \n"
|
" } else { \n"
|
||||||
" if (uColorOnCvg == 0) { \n"
|
|
||||||
" lowp vec4 muxpm0 = muxPM * vec4(equal(vec4(uBlendMux1[0]), vprobe)); \n"
|
" lowp vec4 muxpm0 = muxPM * vec4(equal(vec4(uBlendMux1[0]), vprobe)); \n"
|
||||||
" clampedColor.rgb = muxpm0.rgb; \n"
|
" clampedColor.rgb = muxpm0.rgb; \n"
|
||||||
" } else { \n"
|
|
||||||
" lowp vec4 muxpm2 = muxPM * vec4(equal(vec4(uBlendMux1[2]), vprobe)); \n"
|
|
||||||
" clampedColor.rgb = muxpm2.rgb; \n"
|
|
||||||
" } \n"
|
|
||||||
" } \n"
|
" } \n"
|
||||||
;
|
;
|
||||||
#else
|
#else
|
||||||
|
@ -531,13 +526,8 @@ public:
|
||||||
" lowp vec4 blend2 = muxpm0 * muxa + muxpm2 * muxb; \n"
|
" lowp vec4 blend2 = muxpm0 * muxa + muxpm2 * muxb; \n"
|
||||||
" clampedColor.rgb = clamp(blend2.rgb, 0.0, 1.0); \n"
|
" clampedColor.rgb = clamp(blend2.rgb, 0.0, 1.0); \n"
|
||||||
" } else { \n"
|
" } else { \n"
|
||||||
" if (uColorOnCvg == 0) { \n"
|
|
||||||
" lowp vec4 muxpm0 = muxPM * vec4(equal(vec4(uBlendMux2[0]), vprobe)); \n"
|
" lowp vec4 muxpm0 = muxPM * vec4(equal(vec4(uBlendMux2[0]), vprobe)); \n"
|
||||||
" clampedColor.rgb = muxpm0.rgb; \n"
|
" clampedColor.rgb = muxpm0.rgb; \n"
|
||||||
" } else { \n"
|
|
||||||
" lowp vec4 muxpm2 = muxPM * vec4(equal(vec4(uBlendMux2[2]), vprobe)); \n"
|
|
||||||
" clampedColor.rgb = muxpm2.rgb; \n"
|
|
||||||
" } \n"
|
|
||||||
" } \n"
|
" } \n"
|
||||||
;
|
;
|
||||||
#else
|
#else
|
||||||
|
@ -716,7 +706,6 @@ public:
|
||||||
"uniform lowp int uEnableAlphaTest; \n"
|
"uniform lowp int uEnableAlphaTest; \n"
|
||||||
"uniform lowp int uCvgXAlpha; \n"
|
"uniform lowp int uCvgXAlpha; \n"
|
||||||
"uniform lowp int uAlphaCvgSel; \n"
|
"uniform lowp int uAlphaCvgSel; \n"
|
||||||
"uniform lowp int uColorOnCvg; \n"
|
|
||||||
"uniform lowp float uAlphaTestValue; \n"
|
"uniform lowp float uAlphaTestValue; \n"
|
||||||
"uniform mediump vec2 uScreenScale; \n"
|
"uniform mediump vec2 uScreenScale; \n"
|
||||||
;
|
;
|
||||||
|
@ -791,7 +780,6 @@ public:
|
||||||
"uniform lowp int uEnableAlphaTest; \n"
|
"uniform lowp int uEnableAlphaTest; \n"
|
||||||
"uniform lowp int uCvgXAlpha; \n"
|
"uniform lowp int uCvgXAlpha; \n"
|
||||||
"uniform lowp int uAlphaCvgSel; \n"
|
"uniform lowp int uAlphaCvgSel; \n"
|
||||||
"uniform lowp int uColorOnCvg; \n"
|
|
||||||
"uniform lowp float uAlphaTestValue; \n"
|
"uniform lowp float uAlphaTestValue; \n"
|
||||||
"uniform mediump vec2 uScreenScale; \n"
|
"uniform mediump vec2 uScreenScale; \n"
|
||||||
;
|
;
|
||||||
|
|
|
@ -272,7 +272,6 @@ public:
|
||||||
UBlendMode1Cycle(GLuint _program) {
|
UBlendMode1Cycle(GLuint _program) {
|
||||||
LocateUniform(uBlendMux1);
|
LocateUniform(uBlendMux1);
|
||||||
LocateUniform(uForceBlendCycle1);
|
LocateUniform(uForceBlendCycle1);
|
||||||
LocateUniform(uColorOnCvg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(bool _force) override
|
void update(bool _force) override
|
||||||
|
@ -285,15 +284,11 @@ public:
|
||||||
|
|
||||||
const int forceBlend1 = (int)gDP.otherMode.forceBlender;
|
const int forceBlend1 = (int)gDP.otherMode.forceBlender;
|
||||||
uForceBlendCycle1.set(forceBlend1, _force);
|
uForceBlendCycle1.set(forceBlend1, _force);
|
||||||
|
|
||||||
const int colorOnCvg = (int)gDP.otherMode.colorOnCvg;
|
|
||||||
uColorOnCvg.set(colorOnCvg, _force);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
i4Uniform uBlendMux1;
|
i4Uniform uBlendMux1;
|
||||||
iUniform uForceBlendCycle1;
|
iUniform uForceBlendCycle1;
|
||||||
iUniform uColorOnCvg;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class UBlendMode2Cycle : public UniformGroup
|
class UBlendMode2Cycle : public UniformGroup
|
||||||
|
|
|
@ -540,22 +540,6 @@ void GraphicsDrawer::_setBlendMode() const
|
||||||
} else if ((config.generalEmulation.hacks & hack_blastCorps) != 0 && gDP.otherMode.cycleType < G_CYC_COPY && gSP.texture.on == 0 && currentCombiner()->usesTexture()) { // Blast Corps
|
} else if ((config.generalEmulation.hacks & hack_blastCorps) != 0 && gDP.otherMode.cycleType < G_CYC_COPY && gSP.texture.on == 0 && currentCombiner()->usesTexture()) { // Blast Corps
|
||||||
gfxContext.enable(enable::BLEND, true);
|
gfxContext.enable(enable::BLEND, true);
|
||||||
gfxContext.setBlending(blend::ZERO, blend::ONE);
|
gfxContext.setBlending(blend::ZERO, blend::ONE);
|
||||||
} else if (gDP.otherMode.colorOnCvg != 0) {
|
|
||||||
// CLR_ON_CVG - just use second mux of blender
|
|
||||||
bool useMemColor = false;
|
|
||||||
if (gDP.otherMode.cycleType == G_CYC_1CYCLE) {
|
|
||||||
if (gDP.otherMode.c1_m2a == 1)
|
|
||||||
useMemColor = true;
|
|
||||||
} else if (gDP.otherMode.cycleType == G_CYC_2CYCLE) {
|
|
||||||
if (gDP.otherMode.c2_m2a == 1)
|
|
||||||
useMemColor = true;
|
|
||||||
}
|
|
||||||
if (useMemColor) {
|
|
||||||
gfxContext.enable(enable::BLEND, true);
|
|
||||||
gfxContext.setBlending(blend::ZERO, blend::ONE);
|
|
||||||
} else {
|
|
||||||
gfxContext.enable(enable::BLEND, false);
|
|
||||||
}
|
|
||||||
} else if ((gDP.otherMode.forceBlender == 0 && gDP.otherMode.cycleType < G_CYC_COPY)) {
|
} else if ((gDP.otherMode.forceBlender == 0 && gDP.otherMode.cycleType < G_CYC_COPY)) {
|
||||||
// Just use first mux of blender
|
// Just use first mux of blender
|
||||||
bool useMemColor = false;
|
bool useMemColor = false;
|
||||||
|
@ -563,7 +547,7 @@ void GraphicsDrawer::_setBlendMode() const
|
||||||
if (gDP.otherMode.c1_m1a == 1)
|
if (gDP.otherMode.c1_m1a == 1)
|
||||||
useMemColor = true;
|
useMemColor = true;
|
||||||
} else if (gDP.otherMode.cycleType == G_CYC_2CYCLE) {
|
} else if (gDP.otherMode.cycleType == G_CYC_2CYCLE) {
|
||||||
if (gDP.otherMode.c1_m2a == 1)
|
if (gDP.otherMode.c2_m1a == 1)
|
||||||
useMemColor = true;
|
useMemColor = true;
|
||||||
}
|
}
|
||||||
if (useMemColor) {
|
if (useMemColor) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user