pbrBlockNormalFinal.fx 428 B

123456789101112
  1. #if defined(FORCENORMALFORWARD) && defined(NORMAL)
  2. vec3 faceNormal = normalize(cross(dFdx(vPositionW), dFdy(vPositionW))) * vEyePosition.w;
  3. #if defined(TWOSIDEDLIGHTING)
  4. faceNormal = gl_FrontFacing ? faceNormal : -faceNormal;
  5. #endif
  6. normalW *= sign(dot(normalW, faceNormal));
  7. #endif
  8. #if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
  9. normalW = gl_FrontFacing ? normalW : -normalW;
  10. #endif