Unityã®Occlusion Cullingã®æ©è½ã使ã£ã¦3D空éãå¹ççã«æç»ãã
- Occlusion Culling
- Occluderã¨Occludee
-  Smallest Occluderã¨Smallest Hole
- Occlusion Areaã¨Occlusion Portal
- Occlusion Cullingãããã¾ãå¹ããªãã±ã¼ã¹
- åè
Occlusion Culling
Occlusion Cullingã¨ã¯ãªãã¸ã§ã¯ããé®è½ç©ã«é ãã¦ããå ´åã«ãªãã¸ã§ã¯ããæç»ããªãæ©è½ã§ããä¸ã®ããã«ãé®è½ç©ã§é ãã¦ãããªãã¸ã§ã¯ããæç»ããªãããã«ãã¾ãã
Unityã¯åºæ¬æ©è½ã¨ãã¦éå°ã«ãªã³ã°ãè¡ãã¾ããããã«ãããç»é¢å¤ã«ããã¢ãã«ã®æç»ãã¹ããããã¾ããããããå£ã®åããã®ãªãã¸ã§ã¯ãçã®ãããªãè¦éå°å ã«å«ã¾ãããªãã¸ã§ã¯ãã¯æç»ãã¦ãã¾ãã¾ãï¼ãã¯ã»ã«ã¯å¡ãã¾ããï¼
æç»ã®å 容ã¯Flame Debuggerã§ç¢ºèªããäºãã§ãã¾ããä¸ã®å³ã§ã¯ãå®éã¯ç»é¢ã¯èµ¤ãå£ã§è¦ããã¦ããã®ã§ãããå£ã®åããã®ã¯ã§ãªã¼ã¡ããã®è³ãã¼ããæç»ããã¦ããäºã確èªåºæ¥ã¾ãã
ãããã£ãç¡é§ãªæç»ãã¹ãããããéã«Occlusion Cullingã¯æå¹ã«æ©è½ãã¾ããOcclusionCullingã§äºåã«è¦ããå ´æã»è¦ããªãå ´æãè¨ç®ãã¦ããäºã§ãé常ã«å¹ççã«è¦çå ã®ãªãã¸ã§ã¯ãä¸è¦§ãå¼ã£å¼µãã ããã¨ãåºæ¥ãã¿ããã§ãã
ã¡ãªã¿ã«ãã®Occlusion Culling㯠Umbra Softwareã®æä¾ããã©ã¤ãã©ãªã使ã£ã¦ãã¨ãä½ã¨ãã
Occlusion Cullingãè¨å®ããã«ã¯ãã³ã³ãã¼ãã³ãã«è¡¨ç¤ºãããã¢ãã«ã¯ãOcclusion Cullingã§ã©ãã©ãã«ãªã³ã°ããã¾ããï¼è¨å®ããªããªããã§ãã¯ãå¤ãã¨ãã¨è¯ãããããã¾ããï¼
ã§ã¦ã£ã³ãã¦ãéãã¦ãã¤ã¯ããã ãã§ããããããã°Occlusion Cullingã«ãã§ãã¯ãå ¥ã£ã¦ããã«ã¡ã©ãã¡ã¤ã«ã¯ã·ã¼ã³åã¨åããã©ã«ãã«é ç½®ãããã®ã§ãã·ã¼ã³ãã¡ã¤ã«(.unity)ãå¿ è¦ã§ãã
Occluderã¨Occludee
Occluderã¨Occludeeã«ã¤ãã¦ã§ããå æ¥ãªãããªãã¯ãã¢ãè¦ãéãä½æ ãæ®ã©ã®ãªãã¸ã§ã¯ããOccludeeãè¨å®ããã¦ãããOcclusion Cullingãè¨å®ããã¦ããã«ãé¢ãããé®è½ç©ãæ©è½ãã¦ãã¾ããã§ããã
ã¾ãOccluderã§ãããããã¯Occlusion Cullingã®é®è½ç©ã¨ãã¦æ©è½ãã¾ããè¦ããã«ãOccluderã®è¨å®ããã¦ãããªãã¸ã§ã¯ãããªãã¸ã§ã¯ããé®ãå ´åããã®å ã®ãªãã¸ã§ã¯ãã¯æç»ãããªããªãã¾ããï¼å½ç¶ãStaticãªã®ã§åãããªãäºãåæã§ãï¼
ã¡ãªã¿ã«ã·ã§ã¼ãã¼ã«Transparentï¼ééï¼å±æ§ã®ãããã®ãé¸æãã¦ããå ´åãOccluderã¨ãã¦æ©è½ããªãã£ã½ãã§ãã
ã§ã¯Occludeeã¯ä½ãã¨è¨ãã°ãOcclusion Cullingã§ã«ãªã³ã°ãããå´ã®ãªãã¸ã§ã¯ãã§ããä¾ãã°ãéæãªãªãã¸ã§ã¯ãçã該å½ãã¾ããäºåè¨ç®ããäºã§ãè¨ç®åæ°ãæ¸ããã¦ããã©ã¼ãã³ã¹åä¸ãããã¨ãã£ãæãã§ããããã
å ¨é¨ã®ãªãã¸ã§ã¯ãã«Occluderãè¨å®ããã®ãä¸çªæã£åãæ©ãæ¹æ³ã§ãããå®éã¯å¿ è¦ãªå£ã®ã¿Occluderãè¨å®ãããã以å¤ã¯Occludeeãè¨å®ããã®ãããã©ã¼ãã³ã¹çã«ã¯ä¸çªè¯ãããã§ãã
 Smallest Occluderã¨Smallest Hole
Smallest Occluderã¯æå°ã®é®è½ç©åä½ãSmallest Holeã¯æå°ã®è¦ãç©´åä½ã§ããé ã追ã£ã¦ç¢ºèªãã¦ããã¾ãã
Smallest Occluderã§è¨å®ãããµã¤ãºã¯é®è½ç©ã®æå°åä½ã«ãªãã¾ããä¾ãã°1ã¨æå®ããã¨ãè¦çå¤å®ã«ä½¿ç¨ããã°ãªããã®å¤§ããã¯å¤§ä½1ã«ãªãã¾ããããã«ããããããããã£ã¨ç´°ãããªãã¸ã§ã¯ãã¯ç¡è¦ãããããã«ãªãã¾ãã
ä¸ã®ç»åã¯ãSmallest Occluderã3ãããã«è¨å®ããå ´åã§ãã
Smallest Holeã¯ç©´ã®å¤§ããã§ããééããã£ãéã«ãã©ã®ãããã®ãµã¤ãºã®ééãªãè¦ãããã¨ãã£ãäºã表ç¾ãã¾ãããã®ééãSmallest Hole以ä¸ãªãè¦ãããã å ã«ãªãã¸ã§ã¯ãã表示ããããã以ä¸ãªãé表示ã«ãªãã¾ãã
ãããã¯ç´°ãããã°ç´°ããç¨ã«ç¶ºéºãªã¢ãã«ã®æãåããæå¾ åºæ¥ãã®ã§ãããç´°ãããã°ç´°ããç¨ããã©ã¼ãã³ã¹ã«æªå½±é¿ãä¸ãã¾ããã¾ããã¤ã¯ããã®ã«æéããããã¾ãã
ããã©ã¼ãã³ã¹ã¨ãã¸ã¥ã¢ã«ã天秤ã«ããã¤ã¤èª¿æ´ããã®ãè¯ãããã§ãããªã調æ´ããéã¯å¤§ããªå¤ããå°ãããã¦ããã®ãè¯ãããã§ããå®éãSmallest Occluderã®åæå¤ã®5ã¯å²ã¨å¤§ããå¤ãªããããªããã¨ã
Backface Thresholdã¯ãèªåã®ç解ã§ã¯ããªã´ã³ã«ã«ã¡ã©ãããè¾¼ãã éã«ãã«ãªã³ã°ãããã©ããã®é¾å¤ã§ãã100ã§ã¯ã«ãªã³ã°ãã¦ãã¾ãã¾ãã
Occlusion Areaã¨Occlusion Portal
Occlusion Cullingã¯ãã®ã¾ã¾ã ã¨å ¨ä½ã«å¯¾ãã¦åã精度ã§ããã¾ãããããå®éã¯ç´°ããè¨å®ãã¹ãå ´æã¨ãèãã¦ãè¯ãå ´æãããã¾ããä¸ã®ç»åã¯åºãåºå ´ã®ãããªã¹ãã¼ã¹ãæãã¾ãããä»ã¨åãããã«ã°ãªãããå ¥ã£ã¦ãã¾ãã
ãããã£ãå ´æã¯Occlusion Areaãè¨å®ãã¾ããOcclusion Areaãããã¨ããã®é¨åã¯ç´°ããããã以å¤ã¯é©å½ã«è¨å®ãã¦ãããããã«ãªãã¾ãã
ä»ã²ã¨ã¤ä½ã®å½¹ã«ç«ã¤ã®ãããããªãã®ããOcclusion Portalã§ãããã®ã³ã³ãã¼ãã³ããæå®ããç¯å²å ã«ãããªãã¸ã§ã¯ãã¯ãOcclusion PortalãOFFã®å ´åã«é表示ã«ãªãã¾ãã
æ¨æ¸¬ã§ãããOccluderã®è¨å®ãé£ããå ´æã§ä¸åè¦ãå¿ è¦ã®ç¡ãç©â¦ä¾ãã°éãé¨å±çãããã®æ©è½ã使ã£ã¦ãµã¯ã£ã¨OFFã«ãã¦ããã®ã§ã¯ãªããã¨æãã¾ãã
Occlusion Cullingãããã¾ãå¹ããªãã±ã¼ã¹
å²ã¨æ軽ã§ä¾¿å©ãªOcclusion Cullingã§ããããã¾ãå¹æãåºãªãã±ã¼ã¹ãæãã¾ããä¾ãã°ä»¥ä¸ã®æ§ãªã±ã¼ã¹ã§ãã
ãã®ãããã¯èµ¤ãç·ã®é¨åãè¦çã®ç¯å²ãªã®ã§ãããè¦çå¤â¦ä¾ãã°ã«ã¡ã©ã®å¾ãã®ã¢ãã«ãæ®ã£ã¦ãã¾ãã¾ãã
ä½æ ãããªããã¨è¨ãã¨ããã®ãããã¯åºç»åä½ã§ã¡ãã·ã¥ãçµåãã¦è¡¨ç¾ãã¦ããããã§ããOcclusionCullingã¯ã¡ãã·ã¥åä½ã§æç»ã®ON/OFFãè¡ããããè¦çã®ä¸é¨ã«ã¡ãã·ã¥ãå«ã¾ãã¦ãã¾ã£ã¦ãããã®ã±ã¼ã¹ã§ã¯ä¸æãæ©è½ãã¦ããªã訳ã§ãã
ã¢ãã«ãçµåããã®ã¯GameObjectã®æ°ãæ¸ããæç»ã»CPUçã«ãè¯ãææ³ã ã¨æãã¾ãããããã«ãã£ã¦æç»ã®ã¹ããããåºæ¥ãªããªãå¯è½æ§ãåºã¦ãã¾ããç¹ã«åºå¤§ãªã¹ãã¼ã¸ã§ã¯ã«ãªã³ã°åºæ¥ãªãäºãé«è² è·ã«ãªã£ããããã®ã§ãç¶æ³æ¬¡ç¬¬ã§ä½¿ãåããã®ãè¯ãããã§ãã
åè
utomateï¼Bake Occlusion Cullingï¼
Occlusion Culling in Unity 4.3: The Basics â Unity Blog
Unity - ããã¥ã¢ã«: ãªã¯ã«ã¼ã¸ã§ã³ã«ãªã³ã°
Occlusion Culling In Unity3D-Pro Tutorial - YouTube
GPU Gems - Chapter 29. Efficient Occlusion Culling
Â