Need help with PotentiallyVisibleSetPlugin?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

nashnie
142 Stars 31 Forks 24 Commits 0 Opened issues

Description

离线PotentiallyVisibleSet,用于解决 Unity OcclusionCulling 处理超大地图无法动态加载以及CPU和内存占用较高的问题

Services available

!
?

Need anything else?

Contributors list

# 285,385
C#
23 commits

PotentiallyVisibleSetPlugin

https://en.wikipedia.org/wiki/Potentiallyvisibleset

步骤如下

step1 地图切割成Tile,Tile切割成Portal(视口)和Cell(大物件、中物件、小物件);
step2 检测场景物件所属Cell,一个物件可以属于多个Cell;
step3 利用蒙特卡洛方法Portal随机一些起点,Cell随机一些终点(根据大、中、小随机不同数量的点);
step4 双层遍历每个Portal和Cell,射线检测是否阻挡,如果阻挡,判断阻挡物是否被在当前检测Cell内,如果是,Cell可见;(注,当前设置两个高度检测)
step5 保存检测数据,运行时加载解析,根据玩家位置检测当前Portal,然后遍历场景所有Cell内Item,判断显示和隐藏;

综述

此pvs方案相比于Unity OcclusionCulling
优点:更适合大地图比如5000米x5000米,pvs生成data基于Tile,支持动态加载,占用内存忽略不计,同时CPU消耗也极少;
缺点:剔除没有Unity精细同时烘焙时间较长;

bigworld-occlusionculling

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.