diff --git a/CHANGELOG.md b/CHANGELOG.md index 4561574175..d819dbe303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -112,6 +112,7 @@ Bug #6670: Dialogue order is incorrect Bug #6680: object.cpp handles nodetree unsafely, memory access with dangling pointer Bug #6682: HitOnMe doesn't fire as intended + Bug #6697: Shaders vertex lighting incorrectly clamped Bug #6711: Log time differs from real time Feature #890: OpenMW-CS: Column filtering Feature #1465: "Reset" argument for AI functions diff --git a/files/shaders/groundcover_fragment.glsl b/files/shaders/groundcover_fragment.glsl index d669634190..cb53e7a63e 100644 --- a/files/shaders/groundcover_fragment.glsl +++ b/files/shaders/groundcover_fragment.glsl @@ -73,9 +73,10 @@ void main() vec3 diffuseLight, ambientLight; doLighting(passViewPos, normalize(viewNormal), shadowing, diffuseLight, ambientLight); lighting = diffuseLight + ambientLight; - clampLightingResult(lighting); #endif + clampLightingResult(lighting); + gl_FragData[0].xyz *= lighting; #if @radialFog diff --git a/files/shaders/objects_fragment.glsl b/files/shaders/objects_fragment.glsl index 85950c7468..bf9f207297 100644 --- a/files/shaders/objects_fragment.glsl +++ b/files/shaders/objects_fragment.glsl @@ -194,9 +194,10 @@ void main() doLighting(passViewPos, normalize(viewNormal), shadowing, diffuseLight, ambientLight); vec3 emission = getEmissionColor().xyz * emissiveMult; lighting = diffuseColor.xyz * diffuseLight + getAmbientColor().xyz * ambientLight + emission; - clampLightingResult(lighting); #endif + clampLightingResult(lighting); + gl_FragData[0].xyz *= lighting; #if @envMap && !@preLightEnv diff --git a/files/shaders/terrain_fragment.glsl b/files/shaders/terrain_fragment.glsl index d9d4a6dc30..a8106f4ad5 100644 --- a/files/shaders/terrain_fragment.glsl +++ b/files/shaders/terrain_fragment.glsl @@ -87,9 +87,10 @@ void main() vec3 diffuseLight, ambientLight; doLighting(passViewPos, normalize(viewNormal), shadowing, diffuseLight, ambientLight); lighting = diffuseColor.xyz * diffuseLight + getAmbientColor().xyz * ambientLight + getEmissionColor().xyz; - clampLightingResult(lighting); #endif + clampLightingResult(lighting); + gl_FragData[0].xyz *= lighting; #if @specularMap