Add cvars to sprite shadows progressively according to thing <-> floor distance
This also adds the `r_actorspriteshadowalpha` and `r_actorspriteshadowfadeheight` cvars for greater control (only effective in hardware renderers). These are set to 0.5 and 0 by default, which means this fading behavior is disabled by default. When enabled, this has two benefits: - It becomes easier for the player to judge an entity's height since the shadow opacity now gives this information. - Entities that are far high above the ground no longer cast a shadow, which looked strange.
This commit is contained in:
parent
2d94321887
commit
ad49d52b1c
2 changed files with 22 additions and 2 deletions
|
|
@ -121,6 +121,20 @@ CUSTOM_CVARD(Float, r_actorspriteshadowdist, 1500.0, CVAR_ARCHIVE | CVAR_GLOBALC
|
|||
else if (self > 8192.f)
|
||||
self = 8192.f;
|
||||
}
|
||||
CUSTOM_CVARD(Float, r_actorspriteshadowalpha, 0.5, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "maximum sprite shadow opacity, only effective with hardware renderers (0.0 = fully transparent, 1.0 = opaque)")
|
||||
{
|
||||
if (self < 0.f)
|
||||
self = 0.f;
|
||||
else if (self > 1.f)
|
||||
self = 1.f;
|
||||
}
|
||||
CUSTOM_CVARD(Float, r_actorspriteshadowfadeheight, 0.0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "distance over which sprite shadows should fade, only effective with hardware renderers (0 = infinite)")
|
||||
{
|
||||
if (self < 0.f)
|
||||
self = 0.f;
|
||||
else if (self > 8192.f)
|
||||
self = 8192.f;
|
||||
}
|
||||
|
||||
int viewwindowx;
|
||||
int viewwindowy;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue