![]() ![]() The Dynamic path recreates FMeshBatch every frame. Created FMeshBatches are stored inside FPrimitiveSceneInfo::StaticMeshes and reused every frame until the proxy is removed from the scene. It is implemented by DrawStaticElements, which is called when a proxy is added to the scene. The Cached path builds and reuses FMeshBatch and is preferred for fast rendering of draws which don't change every frame, like Static Meshes. Orange arrows are operations that have to be done every frame, while the blue arrow indicates an operation that is done once before being cached. FPrimitiveSceneProxy implementations control which path is used each frame through the GetViewRelevance() function.įMeshBatch code paths. FMeshDrawCommand is created from a FMeshBatch by a mesh pass specific FMeshPassProcessor.įinally, SubmitMeshDrawCommands is used to convert FMeshDrawCommand into a series of RHI commands set on a RHICommandList.įPrimitiveSceneProxy has two paths for generating FMeshBatches - a cached and a dynamic one. This enables caching and merging the draw calls just above the RHI level. It's a fully stateless draw description that stores everything that the RHI needs to know about a mesh draw: FMeshDrawCommand is an interface between FMeshBatch and the RHI. The next step is to convert FMeshBatch into a mesh pass specific FMeshDrawCommand. It contains everything the pass needs to figure out final shader bindings and render state, so the proxy never knows what passes it will be rendered in. FPrimitiveSceneProxy is responsible for submitting FMeshBatch's to the renderer through the callbacks to GetDynamicMeshElements and DrawStaticElements.įMeshBatch decouples the FPrimitiveSceneProxy implementation (user code) from mesh passes (private renderer module). Mesh rendering starts from FPrimitiveSceneProxy, which is the render thread representation for the game thread's UPrimitiveComponent.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |