ãã¼ãã£ã¯ã«ã«Light追å ãããGPUè² è·ãè·³ãä¸ãã£ã話
çºç«¯: ãã¼ãã£ã¯ã«ç½®ããã"Tiled" Deferredãèµ°ãããã«ãªã£ãã
ä½ããªãã·ã¼ã³ã
ãããã¡ã¤ã«ãã¦ã¿ããã©ã¤ãã£ã³ã°ã¯1.0msãããã
(Startar Contetnsã®)P_Sparksãããã¦ã¿ãã
ãããã¡ã¤ã«ãã¦ã¿ããã©ã¤ãã£ã³ã°ã¯4.03ms!!!!
TiledDeferredã¨ããå¦çãèµ°ãããã«ãªã£ã¦ããã
ã©ããã¦ï¼ ãã¼ãã£ã¯ã«ã«ã©ã¤ãã¢ã¸ã¥ã¼ã«ãããããã§ãã
ã¨ãããã¨ãèµ·ãã¾ãããå®ã¯ããã¼ãã£ã¯ã«ã®ã©ã¤ããä¸åã§ãããã¨ãè£ã§ãã®"Tiled Deferred"ãèµ°ãã¾ãã
ãã®å¦çãé常ã«å¤§éæã«è¨ãã¨ãã©ã¤ããå½±é¿ãä¸ããç»åã®ç¯å²ãåãã£ã¦èª¿ã¹ãä¸è¦ãªãã¯ã»ã«ã¸ã®æç»å¦çãçãææ³ã§ãã ã©ã¤ããã·ã¼ã³ã«æ²¢å±±ããå ´åã¯é常ã«é«éã«ãªãã®ã§ãããããã©ã¤ããé«ã æ°åã®å ´åã¯éã§ããã®âåãã£ã¦èª¿ã¹ãâã¨ããé¨åã®ã³ã¹ããä¸å®éããã£ã¦ãã¾ããããããå¦çè² è·ãå¢å¤§ããã¦ãã¾ãã¾ãã ä»çµã¿ã«ã¤ãã¦è©³ãã説æãã¾ãããæ¡ã®å®ãã¤ãã©ããè¦ããã«çç´ã«ããããã®äºæ³éãå¹³ããã¨ããã¯ã°ãããã«æ£ç´ã«è¨ã£ã¦ãã¾ãã°ãããããããããã¡ãã«ã¤ãã¦è©³ããæ¸ãã¦ããã¾ãã®ã§ããã¡ããåèã«ãã¦ãã ããã
ä½è«ã§ãããUE4ã®åºæ¬è¨å®ã§ã¯ãæ®éã®ãã¤ã³ãã©ã¤ãã80å以ä¸ç½®ãã¨TiledDeferredãèµ°ãã¾ãã(ããããããããããã¨ããããã¾ãã) éãè¨ãã¨ããããããã©ã¤ãã®æ°ãå¢ããªãã¨TiledDeferredã«ããé«éåã®æ©æµãå¾ãããªãã¨ãããã¨ã§ãããªã®ã«ããã¼ãã£ã¯ã«ã®ã©ã¤ãã¯ä¸åã§ãããã¨ããã®ã¿ã¤ã«åå¦çãèµ°ã£ã¦ãã¾ãã®ã§ãã
ã§ã¯ããã¼ãã£ã¯ã«ã©ã¤ãã使ãï¼Tiled Deferredãèµ°ãããªããã¨ããæ¹æ³ã¯åããªããï¼å°ã調ã¹ã¦ã¾ããã.iniã®è¨å®çã§ã¯ã§ããªããã§ãã
ããã¾ããï¼.iniãã¡ã¤ã«ã«
r.TiledDeferredShading=0
ã¨è¨è¼ããããä¸å³ã®æ§ã«ãBlueprintã§ç´æ¥ã³ã³ã½ã¼ã«ã³ãã³ããæã¡è¾¼ããã¨ã§ãæ®éã®ãã£ãã¡ã¼ãã¬ã³ããªã³ã°ã«ãããã¨ãã§ãã¾ãã(ä¸æ¬ã§ã®å¤æ´ã®ã¿ããã®ãã¼ãã£ã¯ã«ã©ã¤ãã ãTiledã§ãããã¨ãã¯ã§ãã¾ããã)
ãã¼ãã£ã¯ã«ã©ã¤ãã¯é常ã«ç¶ºéºãªã®ã§ä½¿ããã人ã¯å¤ãã¨æãã¾ãã ãã®ãã¼ãã£ã¯ã«ã®ã©ã¤ãã£ã³ã°ã«ã¤ãã¦ã¯toaru_designerããã®ä»¥ä¸ã®ã¹ã©ã¤ããé常ã«ãããããã説æãã¦ãã¾ãã®ã§ããã¡ããåèã«ãã¦ãã ããï¼ ãã ãããã¼ãã£ã¯ã«ã©ã¤ãã®æ°ãå°ãªãå ´åã¯ãä¸è¨ã®ã³ãã³ãã§TiledDeferredãèµ°ãããªãæ¹ãè¯ãã§ãããã
ã¾ã¨ã
- åé¡
- ãã¼ãã£ã¯ã«ã®ã©ã¤ãã¢ã¸ã¥ã¼ã«ãç½®ãã¨TiledDeferredã¨ãããã®ãèµ°ã£ã¦GPUã³ã¹ããä¸ãããã©ã¤ãã沢山ããå ´åã¯é«éãªæ©è½ã ããã©ã¤ããå°ãªãå ´åã¯éã«è² è·ãé«ãã¦ãã¾ãã®ã§Offã«ããã»ããè¯ãã
- TiledDeferredãOffã«ããæ¹æ³
- ã»âr.TiledDeferredShading=0âãDefaultEngine.iniã«è¿½å
- ã»ãããã¯execute console commandã§âr.TiledDeferredShading 0âã¨æã¡è¾¼ã
- åè
- ããã¯SM5ãåãPCççã§ã®è¨å®ã§ãã試ãã¦ãã¾ããããã¢ãã¤ã«çã§ã¯ãã®TiledDeferredã®å¦çã¯èµ°ãã¾ããã試ãã¦ã¾ãããã試ãã¦ã¾ãããã©ã誰ã試ãã¦ã
åå : ãªãã§TiledDeferredãèµ°ãã®ï¼
æ¬ä»¶ã®åé¡ã¨ãªãã³ã¼ããè¼ãã¦ããã¾ãã(UE4.6ã§æ¤è¨¼)
FDeferredShadingSceneRenderer::RenderLights()
(RenderLights.cpp)å
ã®ä»¥ä¸ã³ã¼ãã§ãã
if (NumSortedLightsTiledDeferred > 0 || SimpleLights.InstanceData.Num() > 0) { // Update the range that needs to be processed by standard deferred to exclude the lights done with tiled StandardDeferredStart = NumSortedLightsTiledDeferred; RenderTiledDeferredLighting(RHICmdList, SortedLights, NumSortedLightsTiledDeferred, SimpleLights); } }
SimpleLightsãä¸åã§ãã·ã¼ã³ã«ããã¨èªåçã«TiledDeferredãèµ°ãã¾ãã ãã®SimpleLightsãã©ãããéç¨ã§çæãããã®ã詳ããè¦ã¦ãã¾ãããããã¼ãã£ã¯ã«ã®Lightã¢ã¸ã¥ã¼ã«ã¯ãSimpleLightsã¨ãã¦çæãããããã§ãã
ãã®é¨åãèªãã¨ã¢ãã¤ã«ãªã©ã§ã¯ã¿ã¤ã«ãã¼ã¹ã®å¦çã¯èµ°ããªãããã«ãªã£ã¦ããæ§ã§ããã試ãã¦ã¯ããã¾ããã
èªãã§ããã ããããã¨ããããã¾ãã
ãªããè¦ã¤ãããã¡ããã¡ããæ¸ãã¦ãã¾ãã