Division-Technologies / DivisionEngine

ゲームエンジン開発を通して学びを得る
MIT License
0 stars 0 forks source link

メインループを作る #7

Open a3geek opened 2 months ago

a3geek commented 2 months ago

三角形を十字キーで動かす

ruccho commented 2 months ago

MAUIのUIスレッドとメインスレッドを同じにするか

同じにしたほうが混乱は少ないと思うが、なにかMAUI側のレンダリングの制約にエンジンが引っ張られないか不安はある

MAUIのUIスレッドのレンダリング更新タイミングを取る

MAUIのUIスレッドとメインスレッドを同じにするなら、WinUI3の画面更新タイミングにフックする必要がある

CompositionTarget.Rendering イベントが使えそう

https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.compositiontarget.rendering?view=windows-app-sdk-1.2

グラフィックスAPI側のVSyncとの兼ね合いがどうなるかはまだよくわからない

ruccho commented 2 months ago

GPUコマンドの発行に関しては、古典的(?)なメインスレッド + レンダリングスレッドの2スレッド構成のほかに、マルチスレッドレンダリング(コマンドの送信をワーカースレッドに分散させる)にすることもできる……?

また、いまウワサのRenderGraphを使うと、マルチスレッドレンダリングの効率化にも役立つのだとか(これはasync computeに限った話?)

UnrealEngine レンダリングシステムとその拡張 https://www.docswell.com/s/strvert/K38NEM-rendering-system-and-extensions-in-unrealengine

Why Talking About Render Graphs https://logins.github.io/graphics/2021/05/31/RenderGraphs.html

FrameGraph: Extensible Rendering Architecture in Frostbite https://www.gdcvault.com/play/1024612/FrameGraph-Extensible-Rendering-Architecture-in

Benefits of the render graph system https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@17.0/manual/render-graph-benefits.html