Last active
February 9, 2023 02:48
-
-
Save romainguy/113e3f35f47c1a53ace9b392691b98cd to your computer and use it in GitHub Desktop.
Anisotropic IBL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec3 anisotropyDirection = pixel.anisotropy >= 0.0 ? pixel.anisotropicB : pixel.anisotropicT; | |
vec3 anisotropicTangent = cross(anisotropyDirection, shading_view); | |
vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); | |
float bendFactor = abs(pixel.anisotropy) * saturate(5.0 * pixel.roughness); | |
vec3 bentNormal = normalize(mix(shading_normal, anisotropicNormal, bendFactor)); | |
vec3 r = reflect(-shading_view, bentNormal); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment