mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- better sprite shadow control
* exclude sprites which are not either opaque or use regular blended translucency from casting shadows. * exclude wall and flat sprites from casting shadows. In both of these cases the shadow math is unable to produce anything useful that doesn't look off.
This commit is contained in:
parent
2d63974d3a
commit
8547a55677
1 changed files with 7 additions and 0 deletions
|
@ -1075,6 +1075,13 @@ CUSTOM_CVAR(Float, maxviewpitch, 90.f, CVAR_ARCHIVE | CVAR_SERVERINFO)
|
|||
|
||||
bool R_ShouldDrawSpriteShadow(AActor *thing)
|
||||
{
|
||||
auto rs = thing->RenderStyle;
|
||||
rs.CheckFuzz();
|
||||
// For non-standard render styles, draw no shadows. This will always look weird.
|
||||
if (rs.BlendOp != STYLEOP_Add && rs.BlendOp != STYLEOP_Shadow) return false;
|
||||
if (rs.DestAlpha != STYLEALPHA_Zero && rs.DestAlpha != STYLEALPHA_InvSrc) return false;
|
||||
if (thing->renderflags & (RF_FLATSPRITE | RF_WALLSPRITE)) return false; // for wall and flat sprites the shadow math does not work.
|
||||
|
||||
switch (r_actorspriteshadow)
|
||||
{
|
||||
case 1:
|
||||
|
|
Loading…
Reference in a new issue