# 关于Nanite优化 

**URL:** <https://forums.unrealengine.com/t/nanite/2682275>\
**Category:** Rendering\
**Tags:** Epic-Pro-Support, unreal-engine, question\
**Created:** [November 3, 2025, 8:00am UTC](https://forums.unrealengine.com/t/nanite/2682275 "2025-11-03T08:00:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [November 3, 2025, 8:00am UTC](https://forums.unrealengine.com/t/nanite/2682275/1 "2025-11-03T08:00:33Z")

</div>

启用r.Nanite.UseSceneInstanceHierarchy后会在Nanite的GPU pipeline中增加一个HierarchyCellCull Pass，这个Pass会

提前做一些Instance的裁剪工作，目的是减少后续InstanceCull Pass需要裁剪Instance的数量。

我想知道这个HierarchyCellCull具体是怎么工作的，在哪些情况下HierarchyCellCull 才会起作用。这样可以让我们能调整场景最大化利用这个功能以优化Nanite的渲染。

除此之外我们在Switch2的开放中还遇到另一个现象：通过控制台命令NaniteStats显示Nanite的状态，正在同样的场景和视角下，并且未启用r.Nanite.UseSceneInstanceHierarchy，Switch2的Pre-Cull的数量远远高于XSS（Switch2 2000000+，XSS：700000+），请问有哪些可能的原因造成这个现象？或者有没用什么调试方法方便确定哪里出了问题。

---

<div class="post-metadata">

**Author:** ![Liu.Wei](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Liu.Wei](https://forums.unrealengine.com/u/Liu.Wei)\
**Post date:** [November 4, 2025, 10:21am UTC](https://forums.unrealengine.com/t/nanite/2682275/2 "2025-11-04T10:21:56Z")

</div>

Hi,

HierarchicalInstanceCulling不需要特殊的规则，他是始终起效的，每个Instance会根据他的Bounds大小以及Center的位置，会算出这个Instance所在的Block，每个Block包括8x8x8个Cell，会把这个InstanceID记录在这个Block里相应的cell上。然后CPU上会先做粗粒度的Block的Culling，之后在GPU上对Cell做Culling。

我不太确定为什么Switch2上的Pre-Cull远多于XSS，如果场景里的Instance数量是一样的，这个数字应该不会有区别才对。

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [November 5, 2025, 2:50am UTC](https://forums.unrealengine.com/t/nanite/2682275/3 "2025-11-05T02:50:21Z")

</div>

感谢你的回复，现在了解HierarchicalInstanceCulling的工作原理了。

关于第二个问题，经过我们确认，Switch2上的Pre-Cull远多于XSS是因为将植被的Nanite也启用了，但我发现了另外的问题：

我们将植被的密度设置成了0.25（Foliage.Density = 0.25），但Pre-Cull的数量似乎是100%的植被实例数量，并没有因为密度而减少，通过抓帧软件分析，在渲染Nanite物体和生成Shadow Depth过程中InstanceCull Pass的消耗都比较高。这是因为需要从L2中访问大量的数据，而Switch2的带宽成为了瓶颈（如图）：

[Image Removed]所以我想知道有没有方法可以只上传需要渲染的实例数据到GPU，减少GPU内存的访问。

---

<div class="post-metadata">

**Author:** ![Liu.Wei](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Liu.Wei](https://forums.unrealengine.com/u/Liu.Wei)\
**Post date:** [November 5, 2025, 10:06am UTC](https://forums.unrealengine.com/t/nanite/2682275/4 "2025-11-05T10:06:03Z")

</div>

如果是草的话，可以通过grass.densityScale来控制instance的数量，如果是Foliage，用Foliage.Density应该也是起效，可以确认一下FoliageType上的bEnableDensityScaling是否勾起，如果没有勾起，Foliage.Density应该不生效，勾起后，应该还需要重新刷一下Foliage，因为生成的HISM上的bEnableDensityScaling值并没有改变。
