mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Properly remap roughness when reading from radiance map
This ensures that we consistently use perceptual roughness which matches the behaviour of most other PBR renderers like Blender, Ue4 and Godot 3
This commit is contained in:
parent
cdd99e9bec
commit
b2b89d7294
5 changed files with 10 additions and 19 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue