mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Evaluate specular reflections using specular dominant direction instead of assuming mirror reflections
This commit is contained in:
parent
ce6c4ab86a
commit
93c82ab4b9
4 changed files with 38 additions and 23 deletions
|
|
@ -1049,6 +1049,7 @@ void main() {
|
|||
#else
|
||||
vec3 ref_vec = reflect(-view, normal);
|
||||
#endif
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue