rtx: add qrad light intensity scaling

This commit is contained in:
Ivan 'provod' Avdeev 2021-10-16 11:11:32 -07:00 committed by Ivan Avdeev
parent 1b71237279
commit 4935340432

View File

@ -244,6 +244,12 @@ static unsigned parseEntPropClassname(const string value, class_name_e *out, uns
return bit;
}
static void weirdGoldsrcLightScaling( vec3_t intensity ) {
float l1 = Q_max( intensity[0], max( intensity[1], intensity[2] ) );
l1 = l1 * l1 / 10;
VectorScale( intensity, l1, intensity );
}
static void parseStaticLightEntities( void ) {
const model_t* const world = gEngine.pfnGetModelByIndex( 1 );
char *pos;
@ -284,6 +290,8 @@ static void parseStaticLightEntities( void ) {
continue;
}
weirdGoldsrcLightScaling(values._light);
{
vk_light_entity_t *le = g_light_entities.lights + g_light_entities.num_lights++;
VectorCopy(values.origin, le->origin);
@ -853,6 +861,9 @@ static qboolean addDlight( const dlight_t *dlight ) {
dlight->color.g * scaler,
dlight->color.b * scaler,
1.f);
weirdGoldsrcLightScaling( light->color );
Vector4Set(
light->origin,
dlight->origin[0],