Skip to content

Commit 591ecff

Browse files
authored
PBRMetallicRoughnessMaterial: Fix wrong lighting when two sided lighting enabled (#17374)
See https://forum.babylonjs.com/t/wrong-normals-used-for-double-sided-pbr-material-in-right-handed-system/61226
1 parent 00cb114 commit 591ecff

File tree

1 file changed

+1
-1
lines changed
  • packages/dev/core/src/Meshes

1 file changed

+1
-1
lines changed

packages/dev/core/src/Meshes/mesh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2689,7 +2689,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
26892689
!instanceDataStorage.isFrozen &&
26902690
(this._internalMeshDataInfo._effectiveMaterial.backFaceCulling ||
26912691
this._internalMeshDataInfo._effectiveMaterial.sideOrientation !== null ||
2692-
(this._internalMeshDataInfo._effectiveMaterial as any).twoSidedLighting)
2692+
(this._internalMeshDataInfo._effectiveMaterial as any)._twoSidedLighting)
26932693
) {
26942694
// Note: if two sided lighting is enabled, we need to ensure that the normal will point in the right direction even if the determinant of the world matrix is negative
26952695
const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();

0 commit comments

Comments
 (0)