Browse Source

Use the right LOD of an instance when rendering by the depth renderer

Popov72 4 năm trước cách đây
mục cha
commit
dc31ef8db5
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/Materials/Textures/renderTargetTexture.ts

+ 1 - 1
src/Materials/Textures/renderTargetTexture.ts

@@ -769,7 +769,7 @@ export class RenderTargetTexture extends Texture {
                             mesh._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = false;
                         } else {
                             if (!mesh._internalAbstractMeshDataInfo._actAsRegularMesh) {
-                                mesh = (mesh as InstancedMesh).sourceMesh;
+                                mesh = mesh._internalAbstractMeshDataInfo._currentLOD ?? (mesh as InstancedMesh).sourceMesh;
                             }
                         }
                         mesh._internalAbstractMeshDataInfo._isActiveIntermediate = true;