From d0dc14c2c7bf15376d8cb25a8daa874972f8f518 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 10 Jul 2025 05:57:58 +0200 Subject: [PATCH] Add a brightness multiplier for PBR lights to make it closer match classic light model brightness --- wadsrc/static/shaders/scene/lightmodel_pbr.glsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wadsrc/static/shaders/scene/lightmodel_pbr.glsl b/wadsrc/static/shaders/scene/lightmodel_pbr.glsl index 3c39f9961..a1bd70f70 100644 --- a/wadsrc/static/shaders/scene/lightmodel_pbr.glsl +++ b/wadsrc/static/shaders/scene/lightmodel_pbr.glsl @@ -48,6 +48,8 @@ vec3 ProcessLight(const DynLightInfo light, vec3 albedo, float metallic, float r { vec3 L = normalize(light.pos.xyz - pixelpos.xyz); vec3 H = normalize(V + L); + + const float brightnessScale = 2.5; // For making non-PBR and PBR lights roughly the same intensity float attenuation = distanceAttenuation(distance(light.pos.xyz, pixelpos.xyz), light.radius, light.strength, light.linearity); if ((light.flags & LIGHTINFO_SPOT) != 0) @@ -69,7 +71,7 @@ vec3 ProcessLight(const DynLightInfo light, vec3 albedo, float metallic, float r attenuation *= shadowAttenuation(light.pos.xyz, light.shadowIndex, light.softShadowRadius, light.flags); } - vec3 radiance = light.color.rgb * attenuation; + vec3 radiance = light.color.rgb * attenuation * brightnessScale; // cook-torrance brdf float NDF = DistributionGGX(N, H, roughness);