summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 00:55:04 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 00:55:04 +0100
commit6ae8b41dd65f8bc74c80425c17978e5fa1d92b0c (patch)
tree243e90b2511452954375a41cf1b6229cb6ff5267 /src
parentSkybox image: match HDR sky colour decode (diff)
downloadhl2h-6ae8b41dd65f8bc74c80425c17978e5fa1d92b0c.tar.gz
hl2h-6ae8b41dd65f8bc74c80425c17978e5fa1d92b0c.zip
Skybox image: recognise Sky_HDR_DX9 as the HDR sky shader
The material reports shader "Sky_HDR_DX9", not "sky", so the linear/alpha compensation was never applied and the raw sRGB image was scaled by the HDR decode's 8x. Match the Sky_HDR prefix so the compensation path is used.
Diffstat (limited to 'src')
-rw-r--r--src/world.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/world.cpp b/src/world.cpp
index ddd047a..03b30a8 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -872,7 +872,11 @@ bool sky_uses_hdr_shader() {
872 if (!is_sky_material(name, group)) 872 if (!is_sky_material(name, group))
873 continue; 873 continue;
874 const char *shader = vfunc<ShaderFn>(mat, 49)(mat); 874 const char *shader = vfunc<ShaderFn>(mat, 49)(mat);
875 if (shader && strcmp(shader, "sky") == 0) 875 // The shipped shader is registered as "Sky_HDR_DX9" (older SDK name
876 // "sky"); match both and stay case-insensitive about the prefix.
877 if (shader && (strstr(shader, "Sky_HDR") != nullptr ||
878 strstr(shader, "sky_hdr") != nullptr ||
879 strcmp(shader, "sky") == 0))
876 return true; 880 return true;
877 } 881 }
878 return false; 882 return false;