cg小白兔 发表于 2023-2-22 12:28:06

【更新】Frustum Culling 2.0相机视锥体剔除优化工具

本帖最后由 微笑的猫 于 2024-10-15 16:41 编辑


Frustum Culling 系列索引:

Frustum Culling 1.2.2下载链接
Frustum Culling 2.2.2下载链接









WHAT IS FRUSTUM CULLING?
Increase your frames and performance using this tool that disables game objects completely when they're not in view (or distance). Stop events, scripts, animations, sounds, basically any and all components on an object when not in view and re-enable on view, by disabling/enabling the object itself.

WHAT'S THE PURPOSE?
Sometimes, depending on your game, you might have cpu-intensive game objects that are aimlessly taking performance out of your game. So the solution is to completely disable these game objects when out of view (or distance) and re-enable again when in view. A very simple example: is a location fixed NPC that is playing animations and audio, or a puzzle component that is making heavy calculations and validations every frame. They don't need to run when the player isn't looking. For these cases and many more, you can disable these objects and improve your game's performance/frames dramatically.

RENDERING PIPELINES
This package works on all rendering pipelines (built-in, URP & HDRP) but the demos are made for URP and built-in.

DISTANCE CULLING
This asset offers the option to disable game objects by distance also and not only the camera's view.

HOW IS THIS DIFFERENT FROM UNITY'S SOLUTION?
Unity performs Frustum Culling for static objects by default under Occlusion Culling, but you need a custom solution to completely disable the game object as Unity's solution disables the mesh renderer only. This is where this tool comes in. Use it on CPU-intensive objects as the game object will be disabled in it's entirety including all of it's scripts and components when the player isn't looking and back on again when within the frustum. Don't use it on your entire world.

ASSET PACKAGE
This package comes with a demo for built-in and URP, fully-commented source codes and documentation.


什么是Frustum culling?
使用这个工具可以提高你的帧数和性能,当游戏对象不在视图(或距离)中时,可以完全禁用它们。当不在视图中时,停止事件、脚本、动画、声音,基本上是物体上的任何和所有组件,并在视图中重新启用,通过禁用/启用物体本身。

目的是什么?
有时,根据你的游戏,你可能会有CPU密集型的游戏对象,这些对象会漫无目的地占用你的游戏性能。所以解决方案是在离开视野(或距离)时完全禁用这些游戏对象,而在视野中时再重新启用。一个非常简单的例子:一个固定位置的NPC正在播放动画和音频,或者一个每一帧都在进行繁重计算和验证的谜题组件。它们不需要在玩家不看的时候运行。对于这些情况以及更多的情况,你可以禁用这些对象,并极大地提高你的游戏性能/帧数。

渲染管线
这个软件包适用于所有的渲染管线(内置、URP和HDRP),但演示是为URP和内置制作的。

距离删减
这个资产提供了一个选项,可以根据距离来禁用游戏对象,而不仅仅是摄像机的视角。

这与UNITY的解决方案有什么不同?
Unity默认在Occlusion Culling下对静态物体进行Frustum Culling,但是你需要一个自定义的解决方案来完全禁用游戏物体,因为Unity的解决方案只禁用了网格渲染器。这就是这个工具的用处。在CPU密集型对象上使用它,因为当玩家不看时,游戏对象将被完全禁用,包括它的所有脚本和组件,而当在地壳内时,又会重新开启。不要在你的整个世界中使用它。

资产包
这个软件包包括一个内置和URP的演示,完全注释的源代码和文档。






ReidCooper 发表于 2023-7-18 16:24:53

111111111111111111111111111
页: [1]
查看完整版本: 【更新】Frustum Culling 2.0相机视锥体剔除优化工具