diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-03 12:46:25 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-03 12:46:25 +0100 |
commit | 29ddbfa19a7104ee4a7350c78b28378ca96f29c5 (patch) | |
tree | 5b1d59ad394411442867704728ff6c129b356c33 /drivers/gles3/shaders | |
parent | e0f9bc662954e9a5b96619ef203c7cf69a199291 (diff) | |
parent | b2b89d7294ebb0824ce85b8bad59357caf5ec14f (diff) |
Merge pull request #69514 from clayjohn/IBL-roughness
Properly remap roughness when reading from radiance map
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 04dba602dd..75b28dbf2b 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1100,7 +1100,7 @@ void main() { ref_vec = mix(ref_vec, normal, roughness * roughness); float horizon = min(1.0 + dot(ref_vec, normal), 1.0); ref_vec = scene_data.radiance_inverse_xform * ref_vec; - specular_light = textureLod(radiance_map, ref_vec, roughness * RADIANCE_MAX_LOD).rgb; + specular_light = textureLod(radiance_map, ref_vec, sqrt(roughness) * RADIANCE_MAX_LOD).rgb; specular_light = srgb_to_linear(specular_light); specular_light *= horizon * horizon; specular_light *= scene_data.ambient_light_color_energy.a; |