From 661d11c87aaa1adc188aed47dc21be49af6acdf4 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Mon, 12 Jul 2021 10:13:00 +0200 Subject: [PATCH] vmap: implement style, bouncescale, backsplash_fraction and backsplash_distance keys into light_surface --- tools/vmap/light.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tools/vmap/light.c b/tools/vmap/light.c index 3c764d7..4472003 100644 --- a/tools/vmap/light.c +++ b/tools/vmap/light.c @@ -351,20 +351,36 @@ void CreateEntityLights( void ){ float lb; int subd; - - printf("shader test: %s\n", si->shader); + int style; + float bscale, bsfrac, bsdist; if (Q_stricmp(si->shader, surfacename)) continue; lb = FloatForKey( e, "light" ); 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. */ if (lb) si->value = lb; if (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" ); if ( _color && _color[ 0 ] ) {