* Updated to ZDoom r3813:

- Added additive blending for floors and ceilings [in software renderer, OpenGL already had them].

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1440 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2012-08-09 19:05:18 +00:00
parent 89be836bc4
commit 97aa505bb5
5 changed files with 187 additions and 15 deletions

View file

@ -596,7 +596,6 @@ visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightl
else sky = 0; // not skyflatnum so it can't be a sky
skybox = NULL;
alpha = FRACUNIT;
additive = false;
}
// New visplane algorithm uses hash table -- killough
@ -1047,7 +1046,7 @@ void R_DrawHeightPlanes(fixed_t height)
viewy = pl->viewy;
viewangle = pl->viewangle;
MirrorFlags = pl->MirrorFlags;
R_DrawSinglePlane (pl, pl->sky & 0x7FFFFFFF, false, true);
R_DrawSinglePlane (pl, pl->sky & 0x7FFFFFFF, pl->Additive, true);
}
}
}
@ -1528,16 +1527,24 @@ void R_DrawNormalPlane (visplane_t *pl, fixed_t alpha, bool additive, bool maske
else
plane_shade = true;
// Additive not supported yet because the drawer function doesn't look like it can handle it.
if (spanfunc != R_FillSpan)
{
if (masked)
{
if (alpha < OPAQUE)
if (alpha < OPAQUE || additive)
{
spanfunc = R_DrawSpanMaskedTranslucent;
dc_srcblend = Col2RGB8[alpha>>10];
dc_destblend = Col2RGB8[(OPAQUE-alpha)>>10];
if (!additive)
{
spanfunc = R_DrawSpanMaskedTranslucent;
dc_srcblend = Col2RGB8[alpha>>10];
dc_destblend = Col2RGB8[(OPAQUE-alpha)>>10];
}
else
{
spanfunc = R_DrawSpanMaskedAddClamp;
dc_srcblend = Col2RGB8_LessPrecision[alpha>>10];
dc_destblend = Col2RGB8_LessPrecision[FRACUNIT>>10];
}
}
else
{
@ -1546,11 +1553,20 @@ void R_DrawNormalPlane (visplane_t *pl, fixed_t alpha, bool additive, bool maske
}
else
{
if (alpha < OPAQUE)
if (alpha < OPAQUE || additive)
{
spanfunc = R_DrawSpanTranslucent;
dc_srcblend = Col2RGB8[alpha>>10];
dc_destblend = Col2RGB8[(OPAQUE-alpha)>>10];
if (!additive)
{
spanfunc = R_DrawSpanTranslucent;
dc_srcblend = Col2RGB8[alpha>>10];
dc_destblend = Col2RGB8[(OPAQUE-alpha)>>10];
}
else
{
spanfunc = R_DrawSpanAddClamp;
dc_srcblend = Col2RGB8_LessPrecision[alpha>>10];
dc_destblend = Col2RGB8_LessPrecision[FRACUNIT>>10];
}
}
else
{