Enable HDR lighting with Reinhard tonemapping across all world shaders

Replace hardcoded specular multipliers with uLightColor * uSpecularIntensity
uniforms in all 4 world shaders (terrain, WMO, M2, character), set HDR sun
color (1.5, 1.4, 1.3) and specular intensity 0.5 so highlights can exceed
1.0, and switch the post-process pass from passthrough to exposure-compensated
Reinhard (exposure=1.8) for soft highlight roll-off without clipping.
This commit is contained in:
Kelsi 2026-02-04 15:28:47 -08:00
parent 1f672e1d73
commit 09e1ee0ae2
6 changed files with 24 additions and 6 deletions

View file

@ -1176,8 +1176,10 @@ void Renderer::initPostProcess(int w, int h) {
out vec4 FragColor;
void main() {
vec3 color = texture(uScene, vUV).rgb;
// Passthrough — tonemap will kick in once HDR lighting is added
FragColor = vec4(color, 1.0);
float exposure = 1.8;
color *= exposure;
vec3 mapped = color / (color + vec3(1.0));
FragColor = vec4(mapped, 1.0);
}
)";
postProcessShader = std::make_unique<Shader>();