mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
Remove terrain specular and fix washed-out tonemap
Drop specular lighting from terrain shader — ground materials (dirt, grass, stone) are purely diffuse and specular highlights made them look plastic. Replace Reinhard tonemapper with a shoulder-only compressor that is identity below 0.9 and softly rolls off HDR values above, preserving scene contrast.
This commit is contained in:
parent
09e1ee0ae2
commit
1c718dce22
3 changed files with 5 additions and 15 deletions
|
|
@ -1176,9 +1176,9 @@ void Renderer::initPostProcess(int w, int h) {
|
|||
out vec4 FragColor;
|
||||
void main() {
|
||||
vec3 color = texture(uScene, vUV).rgb;
|
||||
float exposure = 1.8;
|
||||
color *= exposure;
|
||||
vec3 mapped = color / (color + vec3(1.0));
|
||||
// Shoulder tonemap: identity below 0.9, soft rolloff above
|
||||
vec3 excess = max(color - 0.9, 0.0);
|
||||
vec3 mapped = min(color, vec3(0.9)) + 0.1 * excess / (excess + 0.1);
|
||||
FragColor = vec4(mapped, 1.0);
|
||||
}
|
||||
)";
|
||||
|
|
|
|||
|
|
@ -324,7 +324,6 @@ void TerrainRenderer::render(const Camera& camera) {
|
|||
// Set lighting
|
||||
shader->setUniform("uLightDir", glm::vec3(lightDir[0], lightDir[1], lightDir[2]));
|
||||
shader->setUniform("uLightColor", glm::vec3(lightColor[0], lightColor[1], lightColor[2]));
|
||||
shader->setUniform("uSpecularIntensity", 0.5f);
|
||||
shader->setUniform("uAmbientColor", glm::vec3(ambientColor[0], ambientColor[1], ambientColor[2]));
|
||||
|
||||
// Set camera position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue