mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
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:
parent
1f672e1d73
commit
09e1ee0ae2
6 changed files with 24 additions and 6 deletions
|
|
@ -90,6 +90,8 @@ bool CharacterRenderer::initialize() {
|
|||
|
||||
uniform sampler2D uTexture0;
|
||||
uniform vec3 uLightDir;
|
||||
uniform vec3 uLightColor;
|
||||
uniform float uSpecularIntensity;
|
||||
uniform vec3 uViewPos;
|
||||
|
||||
uniform vec3 uFogColor;
|
||||
|
|
@ -113,7 +115,7 @@ bool CharacterRenderer::initialize() {
|
|||
vec3 viewDir = normalize(uViewPos - FragPos);
|
||||
vec3 halfDir = normalize(lightDir + viewDir);
|
||||
float spec = pow(max(dot(normal, halfDir), 0.0), 32.0);
|
||||
vec3 specular = spec * vec3(0.2);
|
||||
vec3 specular = spec * uLightColor * uSpecularIntensity;
|
||||
|
||||
// Shadow mapping
|
||||
float shadow = 1.0;
|
||||
|
|
@ -1016,6 +1018,8 @@ void CharacterRenderer::render(const Camera& camera, const glm::mat4& view, cons
|
|||
characterShader->setUniform("uView", view);
|
||||
characterShader->setUniform("uProjection", projection);
|
||||
characterShader->setUniform("uLightDir", glm::vec3(0.0f, -1.0f, 0.3f));
|
||||
characterShader->setUniform("uLightColor", glm::vec3(1.5f, 1.4f, 1.3f));
|
||||
characterShader->setUniform("uSpecularIntensity", 0.5f);
|
||||
characterShader->setUniform("uViewPos", camera.getPosition());
|
||||
|
||||
// Fog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue