Jelajahi Sumber

do not set shadow on instanced mesh

Trevor Baron 6 tahun lalu
induk
melakukan
ce94e19df0
2 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 5 1
      Viewer/src/model/viewerModel.ts
  2. 1 0
      dist/preview release/what's new.md

+ 5 - 1
Viewer/src/model/viewerModel.ts

@@ -196,7 +196,11 @@ export class ViewerModel implements IDisposable {
         if (!mesh.parent) {
             mesh.parent = this._pivotMesh;
         }
-        mesh.receiveShadows = !!this.configuration.receiveShadows;
+
+        if (mesh.getClassName() !== "InstancedMesh") {
+            mesh.receiveShadows = !!this.configuration.receiveShadows;
+        }
+
         this._meshes.push(mesh);
         if (triggerLoaded) {
             return this.onLoadedObservable.notifyObserversWithPromise(this);

+ 1 - 0
dist/preview release/what's new.md

@@ -127,6 +127,7 @@
 - SixDofDragBehavior will support when the camera is parented ([TrevorDev](https://github.com/TrevorDev))
 - Deactivate webvr lasers when not in vr ([TrevorDev](https://github.com/TrevorDev))
 - Update physics position using absolutePosition instead of pivotPosition ([TrevorDev](https://github.com/TrevorDev))
+- Viewer should not set receiveShadows on an instanced mesh ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))