Hello!
I have my own SceneProxy class (for my own component) which is derived from FPrimitiveSceneProxy. In my DrawDynamicElements I construct FMeshBatch and construct multiple FMeshBatchElement objects for it (these correspond to my submeshes). For each submesh I have a unique transform. Here’s how it is rendered:
DrawDynamicElements(FPrimitiveDrawInterface* PDI, const FSceneView* View) {
FMeshBatch Mesh; ..... set vb, vertex factory and other stuff...
FMeshBatchElement& BatchElement = Mesh.Elements[0]; .... set ib, counts here..
// set transform for this submesh
FMatrix TransformMatrix = MyTransform * GetLocalToWorld();
BatchElement.PrimitiveUniformBuffer = CreatePrimitiveUniformBufferImmediate(TransformMatrix, GetBounds(), GetLocalBounds(), false);
PDI->DrawMesh(Mesh);
}
Objects are correctly placed in the scene, but I experience a really weird ghosting effect when I move them in the editor using gizmos (either translate or rotate). If I disable motion blur in editor ghosting goes away. Has anyone encountered this problem or maybe can suggest a solution / work around?
Thanks.