vmap: implement style, bouncescale, backsplash_fraction and backsplash_distance keys into light_surface

This commit is contained in:
Marco Cawthorne 2021-07-12 10:13:00 +02:00
parent b75af3b6c4
commit 661d11c87a

View file

@ -351,20 +351,36 @@ void CreateEntityLights( void ){
float lb; float lb;
int subd; int subd;
int style;
printf("shader test: %s\n", si->shader); float bscale, bsfrac, bsdist;
if (Q_stricmp(si->shader, surfacename)) if (Q_stricmp(si->shader, surfacename))
continue; continue;
lb = FloatForKey( e, "light" ); lb = FloatForKey( e, "light" );
subd = IntForKey( e, "subdivisions" ); subd = IntForKey( e, "subdivisions" );
style = IntForKey( e, "style" );
bscale = FloatForKey( e, "bouncescale" );
/* 0.05 is a default */
bsfrac = FloatForKey( e, "backsplash_fraction" ) * 0.01f;
/* 23 units apparently is the default */
bsdist = FloatForKey( e, "backsplash_distance" );
/* only apply when things are set. */ /* only apply when things are set. */
if (lb) if (lb)
si->value = lb; si->value = lb;
if (subd) if (subd)
si->lightSubdivide = subd; si->lightSubdivide = subd;
if (style)
si->lightStyle = style;
if (bscale)
si->bounceScale = bscale;
if (bsfrac)
si->backsplashFraction = bsfrac;
if (bsdist)
si->backsplashDistance = bsdist;
_color = ValueForKey( e, "color" ); _color = ValueForKey( e, "color" );
if ( _color && _color[ 0 ] ) { if ( _color && _color[ 0 ] ) {