|
@@ -18,7 +18,6 @@ import { Constants } from "../../Engines/constants";
|
|
|
|
|
|
import "../../Engines/Extensions/engine.renderTarget";
|
|
import "../../Engines/Extensions/engine.renderTarget";
|
|
import "../../Engines/Extensions/engine.renderTargetCube";
|
|
import "../../Engines/Extensions/engine.renderTargetCube";
|
|
-import { InstancedMesh } from '../../Meshes/instancedMesh';
|
|
|
|
import { Engine } from '../../Engines/engine';
|
|
import { Engine } from '../../Engines/engine';
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -742,7 +741,7 @@ export class RenderTargetTexture extends Texture {
|
|
for (var meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) {
|
|
for (var meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) {
|
|
var mesh = currentRenderList[meshIndex];
|
|
var mesh = currentRenderList[meshIndex];
|
|
|
|
|
|
- if (mesh) {
|
|
|
|
|
|
+ if (mesh && !mesh.isBlocked) {
|
|
if (this.customIsReadyFunction) {
|
|
if (this.customIsReadyFunction) {
|
|
if (!this.customIsReadyFunction(mesh, this.refreshRate)) {
|
|
if (!this.customIsReadyFunction(mesh, this.refreshRate)) {
|
|
this.resetRefreshCounter();
|
|
this.resetRefreshCounter();
|
|
@@ -754,6 +753,16 @@ export class RenderTargetTexture extends Texture {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (!mesh._internalAbstractMeshDataInfo._currentLODIsUpToDate && scene.activeCamera) {
|
|
|
|
+ mesh._internalAbstractMeshDataInfo._currentLOD = scene.customLODSelector ? scene.customLODSelector(mesh, scene.activeCamera) : mesh.getLOD(scene.activeCamera);
|
|
|
|
+ mesh._internalAbstractMeshDataInfo._currentLODIsUpToDate = true;
|
|
|
|
+ }
|
|
|
|
+ if (!mesh._internalAbstractMeshDataInfo._currentLOD) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let meshToRender = mesh._internalAbstractMeshDataInfo._currentLOD;
|
|
|
|
+
|
|
mesh._preActivateForIntermediateRendering(sceneRenderId);
|
|
mesh._preActivateForIntermediateRendering(sceneRenderId);
|
|
|
|
|
|
let isMasked;
|
|
let isMasked;
|
|
@@ -764,19 +773,22 @@ export class RenderTargetTexture extends Texture {
|
|
}
|
|
}
|
|
|
|
|
|
if (mesh.isEnabled() && mesh.isVisible && mesh.subMeshes && !isMasked) {
|
|
if (mesh.isEnabled() && mesh.isVisible && mesh.subMeshes && !isMasked) {
|
|
|
|
+ if (meshToRender !== mesh) {
|
|
|
|
+ meshToRender._activate(sceneRenderId, true);
|
|
|
|
+ }
|
|
if (mesh._activate(sceneRenderId, true) && mesh.subMeshes.length) {
|
|
if (mesh._activate(sceneRenderId, true) && mesh.subMeshes.length) {
|
|
if (!mesh.isAnInstance) {
|
|
if (!mesh.isAnInstance) {
|
|
- mesh._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = false;
|
|
|
|
|
|
+ meshToRender._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = false;
|
|
} else {
|
|
} else {
|
|
- if (!mesh._internalAbstractMeshDataInfo._actAsRegularMesh) {
|
|
|
|
- mesh = mesh._internalAbstractMeshDataInfo._currentLOD ?? (mesh as InstancedMesh).sourceMesh;
|
|
|
|
|
|
+ if (mesh._internalAbstractMeshDataInfo._actAsRegularMesh) {
|
|
|
|
+ meshToRender = mesh;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- mesh._internalAbstractMeshDataInfo._isActiveIntermediate = true;
|
|
|
|
|
|
+ meshToRender._internalAbstractMeshDataInfo._isActiveIntermediate = true;
|
|
|
|
|
|
- for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
|
|
|
|
- var subMesh = mesh.subMeshes[subIndex];
|
|
|
|
- this._renderingManager.dispatch(subMesh, mesh);
|
|
|
|
|
|
+ for (var subIndex = 0; subIndex < meshToRender.subMeshes.length; subIndex++) {
|
|
|
|
+ var subMesh = meshToRender.subMeshes[subIndex];
|
|
|
|
+ this._renderingManager.dispatch(subMesh, meshToRender);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|