mirror of https://github.com/mgba-emu/mgba.git
GBA Video: GL semitransparent OBJs
This commit is contained in:
parent
c15dedf3f4
commit
509c80abad
|
@ -240,8 +240,14 @@ static const char* const _composite =
|
||||||
" pix += oldpix * blend.y;\n"
|
" pix += oldpix * blend.y;\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" } else {\n"
|
" } else {\n"
|
||||||
" pix = texelFetch(oldLayer, ivec2(texCoord * scale), 0);\n"
|
|
||||||
" outflags = oflags;\n"
|
" outflags = oflags;\n"
|
||||||
|
" vec4 oldpix = texelFetch(oldLayer, ivec2(texCoord * scale), 0);\n"
|
||||||
|
" if (oflags.z == 1 && (oflags.y & 1) == 1 && (inflags.y & 2) == 2) {\n"
|
||||||
|
" pix *= blend.y;\n"
|
||||||
|
" pix += oldpix * blend.x;\n"
|
||||||
|
" } else {\n"
|
||||||
|
" pix = oldpix;\n"
|
||||||
|
" }\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" color = pix;\n"
|
" color = pix;\n"
|
||||||
" flags = outflags / flagCoeff;\n"
|
" flags = outflags / flagCoeff;\n"
|
||||||
|
@ -993,7 +999,7 @@ void GBAVideoGLRendererDrawSprite(struct GBAVideoGLRenderer* renderer, struct GB
|
||||||
glUniform1i(4, charBase);
|
glUniform1i(4, charBase);
|
||||||
glUniform1i(5, stride);
|
glUniform1i(5, stride);
|
||||||
glUniform1i(6, GBAObjAttributesCGetPalette(sprite->c));
|
glUniform1i(6, GBAObjAttributesCGetPalette(sprite->c));
|
||||||
glUniform3i(7, GBAObjAttributesCGetPriority(sprite->c) << 3, renderer->target1Obj | (renderer->target2Obj * 2), 0);
|
glUniform3i(7, GBAObjAttributesCGetPriority(sprite->c) << 3, (renderer->target1Obj || GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT) | (renderer->target2Obj * 2), GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT ? BLEND_ALPHA : renderer->blendEffect);
|
||||||
if (GBAObjAttributesAIsTransformed(sprite->a)) {
|
if (GBAObjAttributesAIsTransformed(sprite->a)) {
|
||||||
struct GBAOAMMatrix mat;
|
struct GBAOAMMatrix mat;
|
||||||
LOAD_16(mat.a, 0, &renderer->d.oam->mat[GBAObjAttributesBGetMatIndex(sprite->b)].a);
|
LOAD_16(mat.a, 0, &renderer->d.oam->mat[GBAObjAttributesBGetMatIndex(sprite->b)].a);
|
||||||
|
|
Loading…
Reference in New Issue