Map in the top: foliage is a mesh with 4 planes | 0.02ms frame sync time
Map in the bottom: foliage is a mesh with 1 plane | 5.65ms frame sync time
both have a triangle count of 2 million and the same lighting conditions
looks like with a single plane as foliage there is just the frame sync time added…
What is happening here?
btw. forward shading and deffered rendering mode show the same effect
{
SCOPE_CYCLE_COUNTER(STAT_FrameSyncTime);
// this could be perhaps moved down to get greater parallelism
// Sync game and render thread. Either total sync or allowing one frame lag.
static FFrameEndSync FrameEndSync;
static auto CVarAllowOneFrameThreadLag = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.OneFrameThreadLag"));
FrameEndSync.Sync( CVarAllowOneFrameThreadLag->GetValueOnGameThread() != 0 );
}
Looks like with a single grass blade, you have too many draw calls and the game thread waits longer for the render thread to finish drawing all the blades, so it can be synced
I think what is causing the higher rendertime and therefor the game thread and render thread to wait for each other here, is the fact that the GPU has to calculate the transformation (locaiton, rotaion, scale) of the vertex points for every instance. This process needs to happen with reading different values for every single instance, wich is obviously way more often on a single plane than on a bunch of planes to result in the same triangles processed.