mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-01-16 13:00:27 +01:00
Perform full blending for mat.a != 0xFF, should fade-in sprites (eg, Trees)
This commit is contained in:
parent
5abd0641a4
commit
0a0a664428
6
vendor/librw/src/dc/rwdc.cpp
vendored
6
vendor/librw/src/dc/rwdc.cpp
vendored
@ -3294,6 +3294,8 @@ void defaultRenderCB(ObjPipeline *pipe, Atomic *atomic) {
|
|||||||
|
|
||||||
for (int16_t n = 0; n < numMeshes; n++) {
|
for (int16_t n = 0; n < numMeshes; n++) {
|
||||||
bool doBlend = meshes[n].material->color.alpha != 255; // TODO: check all vertexes for alpha?
|
bool doBlend = meshes[n].material->color.alpha != 255; // TODO: check all vertexes for alpha?
|
||||||
|
bool doBlendMaterial = doBlend;
|
||||||
|
|
||||||
bool textured = geo->numTexCoordSets && meshes[n].material->texture;
|
bool textured = geo->numTexCoordSets && meshes[n].material->texture;
|
||||||
if (textured) {
|
if (textured) {
|
||||||
doBlend |= Raster::formatHasAlpha(meshes[n].material->texture->raster->format);
|
doBlend |= Raster::formatHasAlpha(meshes[n].material->texture->raster->format);
|
||||||
@ -3343,7 +3345,7 @@ void defaultRenderCB(ObjPipeline *pipe, Atomic *atomic) {
|
|||||||
pvr_poly_cxt_t cxt;
|
pvr_poly_cxt_t cxt;
|
||||||
int pvrList;
|
int pvrList;
|
||||||
if (doBlend || isMatFX) {
|
if (doBlend || isMatFX) {
|
||||||
if (doAlphaTest) {
|
if (doAlphaTest && !doBlendMaterial) {
|
||||||
pvrList = PVR_LIST_PT_POLY;
|
pvrList = PVR_LIST_PT_POLY;
|
||||||
} else {
|
} else {
|
||||||
pvrList = PVR_LIST_TR_POLY;
|
pvrList = PVR_LIST_TR_POLY;
|
||||||
@ -3709,7 +3711,7 @@ void defaultRenderCB(ObjPipeline *pipe, Atomic *atomic) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (doBlend || isMatFX) {
|
if (doBlend || isMatFX) {
|
||||||
if (doAlphaTest) {
|
if (doAlphaTest && !doBlendMaterial) {
|
||||||
ptCallbacks.emplace_back(std::move(renderCB));
|
ptCallbacks.emplace_back(std::move(renderCB));
|
||||||
} else {
|
} else {
|
||||||
blendCallbacks.emplace_back(std::move(renderCB));
|
blendCallbacks.emplace_back(std::move(renderCB));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user