소스 검색

Bug fixes

Gary Hsu 8 년 전
부모
커밋
3c094ab00d
2개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      src/Materials/PBR/babylon.pbrBaseMaterial.ts
  2. 1 2
      src/Shaders/pbr.fragment.fx

+ 1 - 1
src/Materials/PBR/babylon.pbrBaseMaterial.ts

@@ -1264,7 +1264,7 @@
                 scene.ambientColor.multiplyToRef(this._ambientColor, this._globalAmbientColor);
 
                 var eyePosition = scene._mirroredCameraPosition ? scene._mirroredCameraPosition : scene.activeCamera.globalPosition;
-                var invertNormal = (scene.useRightHandedSystem === (scene._mirroredCameraPosition !== undefined));
+                var invertNormal = (scene.useRightHandedSystem === (scene._mirroredCameraPosition != null));
                 effect.setFloat4("vEyePosition",
                     eyePosition.x,
                     eyePosition.y,

+ 1 - 2
src/Shaders/pbr.fragment.fx

@@ -234,8 +234,7 @@ void main(void) {
 		faceNormal = gl_FrontFacing ? faceNormal : -faceNormal;
 	#endif
 
-	float comp = sign(dot(normalW, faceNormal));
-    normalW *= -comp;
+	normalW *= sign(dot(normalW, faceNormal));
 #endif
 
 #if defined(TWOSIDEDLIGHTING) && defined(NORMAL)