hemilight_fragment.glsl 382 B

123456789101112131415161718
  1. #if MAX_HEMI_LIGHTS > 0
  2. for ( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {
  3. vec3 lightDir = hemisphereLightDirection[ i ];
  4. float dotProduct = dot( normal, lightDir );
  5. float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;
  6. vec3 lightColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );
  7. totalAmbientLight += lightColor;
  8. }
  9. #endif