找回密码
 立即注册
搜索

[编辑器/功能拓展] Frustum Culling 1.2.2

[复制链接]
297 |0
发表于 2023-9-20 14:35:47 | 显示全部楼层 |阅读模式










WHAT IS FRUSTUM CULLING?
Frustum Culling can improve both the framerate and the performance of your game by disabling game objects completely when they're not in view (or distance) of the camera. Stop events, scripts, animations, sounds, basically any and all components on an object when it’s not in view and then re-enable when back in view by disabling/enabling the object itself.

WHY USE FRUSTUM CULLING?
Sometimes, depending on your game, you may have CPU intensive game objects that are affecting the performance of your game even when they aren’t being seen by the player. To remedy this, we can disable these game objects whenever they are out of view (or distance) and then re-enable them when they are back in view. A puzzle/interactable object that is making heavy calculations and validations every frame, for example, may not need to run when the player isn't looking. Disabling these game objects when not in view can sometimes improve the framerate of your game dramatically.

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

DYNAMIC OBJECTS
Frustum Culling works on dynamic game objects. Even those generated at runtime.

DISTANCE CULLING
You can also, optionally, disable game objects based on the distance of the camera, as well as the view.

HOW IS THIS DIFFERENT FROM UNITY'S SOLUTION?
Unity performs Frustum Culling on static objects by default under Occlusion Culling. You need a custom solution, however, to completely disable the game object as Unity's solution merely disables the mesh renderer. Using our tool, you can disable a game object in its entirety and thus save even more on performance than standard Unity solutions would allow. On the other hand, it is recommended to not use it on one’s entire world.

DOCUMENTATION
The package comes with documentation and fully commented source code as well as a demo for Built-in and URP to help give you a running start.


什么是截锥体剔除?
截锥体剔除可以通过完全禁用不在摄像机视野(或距离)内的游戏对象来提高游戏的帧率和性能。停止事件,脚本,动画,声音,基本上任何和所有组件上的对象,当它不在视图中,然后重新启用时,通过禁用/启用对象本身在视图中。

为什么要使用截锥体剔除?
有时候,根据你的游戏,你可能会有CPU密集型的游戏对象,即使玩家看不到它们也会影响游戏的性能。为了解决这个问题,我们可以在这些游戏对象离开视线(或距离)时禁用它们,然后在它们回到视线时重新启用它们。例如,每一帧都需要进行大量计算和验证的谜题/可交互对象可能不需要在玩家不看的时候运行。当这些游戏对象不在可视范围内时禁用它们有时可以显著提高游戏的帧率。

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

动态对象
Frustum Culling适用于动态游戏对象。即使是在运行时生成的。

距离扑杀
你也可以,选择性地,禁用游戏对象基于相机的距离,以及视图。

这和unity的解决方案有什么不同?
Unity默认在遮挡剔除下对静态对象执行截锥体剔除。然而,你需要一个自定义的解决方案来完全禁用游戏对象,因为Unity的解决方案仅仅禁用了网格渲染器。使用我们的工具,你可以完全禁用游戏对象,从而节省比标准Unity解决方案更多的性能。另一方面,建议不要在整个世界使用它。

文档
该软件包附带文档和完整注释的源代码,以及内置和URP的演示,以帮助您开始运行。





回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

热门版块
热门帖子
1
2
畅想自由职业新境界
水煮鱼
2024-10-12
3
突破时空束缚的理想之选
水煮鱼
2024-10-12
4
放慢脚步享受 工作
水煮鱼
2024-10-12
5
职场混的不好来这里吧
水煮鱼
2024-10-11
6
人生无大事儿就是搞钱
水煮鱼
2024-10-10
快速回复 返回顶部 返回列表