Improve foliage rebuilding logic and add visibility check for foliage renderer
This commit is contained in:
@@ -1707,6 +1707,11 @@ export class ViewportHost {
|
|||||||
this.applyViewModePose();
|
this.applyViewModePose();
|
||||||
this.applyAdvancedRenderingCameraFar(this.currentAdvancedRenderingSettings);
|
this.applyAdvancedRenderingCameraFar(this.currentAdvancedRenderingSettings);
|
||||||
this.syncFoliageVisibility();
|
this.syncFoliageVisibility();
|
||||||
|
|
||||||
|
if (this.currentDocument !== null) {
|
||||||
|
this.rebuildFoliage(this.currentDocument);
|
||||||
|
}
|
||||||
|
|
||||||
this.syncTerrainBrushPreview();
|
this.syncTerrainBrushPreview();
|
||||||
|
|
||||||
if (this.currentAdvancedRenderingSettings !== null) {
|
if (this.currentAdvancedRenderingSettings !== null) {
|
||||||
@@ -6643,6 +6648,12 @@ export class ViewportHost {
|
|||||||
|
|
||||||
private rebuildFoliage(document: SceneDocument) {
|
private rebuildFoliage(document: SceneDocument) {
|
||||||
this.syncFoliageVisibility();
|
this.syncFoliageVisibility();
|
||||||
|
|
||||||
|
if (!this.foliageRenderer.group.visible) {
|
||||||
|
this.foliageRenderer.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.foliageRenderer.sync({
|
this.foliageRenderer.sync({
|
||||||
terrains: document.terrains,
|
terrains: document.terrains,
|
||||||
foliageLayers: document.foliageLayers,
|
foliageLayers: document.foliageLayers,
|
||||||
|
|||||||
Reference in New Issue
Block a user