Skip to content

Commit

Permalink
ShaderChunks: Fixed dotNV redefinition shader crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed May 25, 2022
1 parent 0786073 commit e60a802
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPositi
#ifdef USE_IRIDESCENCE
float dotNV = saturate( dot( normal, geometry.viewDir ) );
float dotNVi = saturate( dot( normal, geometry.viewDir ) );
if ( material.iridescenceThickness == 0.0 ) {
Expand All @@ -42,10 +42,10 @@ if ( material.iridescenceThickness == 0.0 ) {
if ( material.iridescence > 0.0 ) {
material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNV, material.iridescenceThickness, material.specularColor );
material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
// Iridescence F0 approximation
material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNV );
material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
}
Expand Down

0 comments on commit e60a802

Please sign in to comment.