Where to do call DrawIndexedPrimitiveUP
I'm currently creating a ocean plane mesh with LOD like the NVIDIA demo in 2008 in c++ with the hope of digging into unreal engine rendering system,
Using information from https://forums.unrealengine.com/showthread.php?1552-Generate-Procedural-Mesh to generate a plane for the ocean surface.
I'm at the part where in the NVIDIA demo code, it do the d3d11Context->DrawIndexed() call
AFAIK the same call can be done in Unreal Engine with, DrawIndexedPrimitiveUP(), but I can't seem to locate the first parameter to pass, which is a RHICmdList
Here's my code,
What I'm wondering is where do I should do the DrawIndexedPrimitiveUP call? I think what I did there is safe since it happens on RenderThread (I checked on visual studio threads window).
Comments from Unreal Dev would be really helpful, so I could know if what I did is "the right way to do it" in unreal.
Unfortunately it's not that simple. DrawDynamicElements is a callback to the engine module so it knows nothing of renderer internals like the command list. All DrawDynamicElements can do is submit an FMeshBatch description of something to draw, and FMeshDrawingPolicy::DrawMesh will make the actual call to DrawIndexedPrimitiveUP. Sometimes you have to modify FMeshBatch to pass through the data that you want.
Note that in newer builds, DrawDynamicElements is replaced with GetDynamicMeshElements, which is only called once at the beginning of the frame instead of every pass.
answered Mar 02 '15 at 09:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here