mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-21 11:01:36 +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
3302a12da6
commit
58e7e5093a
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