diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index fd8d80725a5..65fb4ac8b92 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -1693,6 +1693,8 @@ FRAGMENT_SHADER_CODE ref_vec.z *= -1.0; specular_light = textureCubeLod(radiance_map, ref_vec, roughness * RADIANCE_MAX_LOD).xyz * bg_energy; + float horizon = min(1.0 + dot(ref_vec, normal), 1.0); + specular_light *= horizon * horizon; #ifndef USE_LIGHTMAP { vec3 ambient_dir = normalize((radiance_inverse_xform * vec4(normal, 0.0)).xyz); diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index dccf216cb00..2d9a79a225c 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1887,6 +1887,8 @@ FRAGMENT_SHADER_CODE ref_vec = normalize((radiance_inverse_xform * vec4(ref_vec, 0.0)).xyz); vec3 radiance = textureDualParaboloid(radiance_map, ref_vec, roughness) * bg_energy; env_reflection_light = radiance; + float horizon = min(1.0 + dot(ref_vec, normal), 1.0); + env_reflection_light *= horizon * horizon; } } #ifndef USE_LIGHTMAP