From 98f0b381b8368ce969e29349c71da93570bcf691 Mon Sep 17 00:00:00 2001 From: schmelczerandras Date: Tue, 13 Oct 2020 22:57:27 +0200 Subject: [PATCH] Fix lighting difference between webgl and webgl2 --- src/graphics/rendering/shaders/shading-fs-100.glsl | 4 ++-- src/graphics/rendering/shaders/shading-fs.glsl | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/graphics/rendering/shaders/shading-fs-100.glsl b/src/graphics/rendering/shaders/shading-fs-100.glsl index db05b9f..f70e322 100644 --- a/src/graphics/rendering/shaders/shading-fs-100.glsl +++ b/src/graphics/rendering/shaders/shading-fs-100.glsl @@ -68,7 +68,7 @@ void main() { vec3 colorAtPosition = rgbaColorAtPosition.rgb; vec3 lighting = ambientLight; - vec3 lightingInside = lighting * INTENSITY_INSIDE_RATIO; + vec3 lightingInside = ambientLight; #ifdef CIRCLE_LIGHT_COUNT #if CIRCLE_LIGHT_COUNT > 0 @@ -121,7 +121,7 @@ void main() { #endif vec3 outsideColor = {backgroundColor}.rgb * lighting; - vec3 insideColor = colorAtPosition * lightingInside; + vec3 insideColor = colorAtPosition * lightingInside * INTENSITY_INSIDE_RATIO; float edge = clamp(startingDistance / shadingNdcPixelSize, 0.0, 1.0); vec3 antialiasedColor = mix(insideColor, outsideColor, edge); diff --git a/src/graphics/rendering/shaders/shading-fs.glsl b/src/graphics/rendering/shaders/shading-fs.glsl index 9050a78..ea1384f 100644 --- a/src/graphics/rendering/shaders/shading-fs.glsl +++ b/src/graphics/rendering/shaders/shading-fs.glsl @@ -86,7 +86,6 @@ void main() { float startingDistance = getDistance(uvCoordinates); - vec3 lighting = ambientLight; vec3 lightingInside = ambientLight;