<aside> ℹ️ FStaticMeshSceneProxy::DrawStaticElements
</aside>
In this part, we are talking about this step:
If you have forgotten the previous brief discussion, please click here.
<aside> ❓ Do we need to do this every frame?
</aside>
No, we can cache the mesh batch at the beginning or when anything changes.
Since we are dealing with a static mesh, the cube's vertices will not change, and the static mesh component is not movable, so it cannot move.
It means at least in our test case, the mesh batch is always the same.
<aside> ℹ️ FScene::UpdateAllPrimitiveSceneInfos
</aside>
So, what is that timing? It is **FScene**::UpdateAllPrimitiveSceneInfos
.
I will give you a image to let you know where it is:
This image shows:
UpdateAllPrimitiveSceneInfos
runs in the render thread, not the game thread.UpdateAllPrimitiveSceneInfos
runs before actor ticks.