Heavy performance drop with Hybrid Renderer in Unity 2020.3

Currently happening on unity 2020.3.6
with Hybrid renderer 0.11.0 preview 42
and Universal render pipeline 10.4.0

Tested Cases:

I have been testing on PC
having 12k entities

Built-in render pipeline with GameObjects
~60fps ~16ms average

Built-in render pipeline with Entities and hybrid renderer v1
~200fps ~5ms average

Built-in render pipeline with Entities and ENABLE_HYBRID_RENDERER_V2
~52fps ~19ms average (Even worst than not using ecs at all)
EDIT: This specific case was tested wrong

URP with Entities and hybrid renderer v1
~200fps ~5ms average (Entities not visible and seems there is not compatibility with V1 anymore)

URP with Entities and ENABLE_HYBRID_RENDERER_V2
~55fps ~18ms average (Even worst than not using ecs at all Again)

I have reported the issue, I hope it gets solved soon, or someone tell me what I’m doing wrong

1 Like

In case it helps as a reference point, 2020.3.1f1, HR 0.11.0 & URP 10.3.2, HR V2 enabled I can comfortably render more than 100k dynamic animated simple lit cube entities with a directional light & shadows @ > 60fps (980ti, 3900x), in editor. It could be your meshes or materials are much more complex than this toy example but just to check the obvious - Enable GPU Instancing is enabled on your URP material?

1 Like


I’m in the newer 2020 version currently
And something is definitely wrong with V2
it seem like is batching Each cube separatedly

GPU Instanced is enabled

Could you paste a screenshot of a problematic frame from the Unity Profiler? That should provide some insight into why your rendering is slower than expected. If Hybrid Renderer is taking a lot of CPU time, please verify that Burst is enabled (Jobs > Burst > Enable compilation).

EDIT: Another possible cause of slowdown is if your entities are using a transparent material. Hybrid Renderer V2 renders such entities separately by default, so they can be depth sorted to produce the correct result. If you do not care about depth sorting, you can disable this behavior using the DISABLE_HYBRID_TRANSPARENCY_BATCH_PARTITIONING scripting define, after which HRV2 should batch them similarly to HRV1.

Also, some things worth mentioning here:

  • The built-in render pipeline is not compatible Hybrid Renderer V2.
  • “GPU Instanced” does not affect HRV2. It only affects HRV1, which requires it to be enabled.
  • The “batching” statistics are not accurate for any version of Hybrid Renderer. Those statistics are for Unity’s built-in GameObject batching. For Hybrid Renderer, the only important statistics are the CPU main thread and render thread time.
7 Likes

This is Built in render pipeline with gameobjects, even no logic at all, just rendering
7102390--846646--upload_2021-5-3_15-57-42.png

This is Built in render pipeline with V1 HR
7102390--846643--upload_2021-5-3_15-56-33.png

URP HR V2 (jobsDebuger: OFF LeakDetection: OFF safetyChecks: OFF EnableCompilation: Enabled )
7102390--846652--upload_2021-5-3_16-9-11.png

A better screenshot for
URP HR V2 (jobsDebuger: OFF LeakDetection: OFF safetyChecks: OFF EnableCompilation: Enabled )

ok i was using transparent shaders, i will try it without being transparent so it should work too right?

Ok this is what i have seen

If you convert the entities using non transparent shader it works correctly as expected

BUT
if i change the material to transparent in runtime the entities change to transparent and the framerate stays good

Also viceversa
If i have Transparent entities running slowly if i change the material in runtime it continues slow

This is weird, i would like to know why is that

Also
DISABLE_HYBRID_TRANSPARENCY_BATCH_PARTITIONING
Works like a charm

I highly recommend u to submit bug report and post your case number at here.

well that last bug has noting to do with this post, it should be in a different thread i think
Also I suppose its happens because when the entity is already converted they stay in the same batch groups, acting like enabling that last DISABLE_HYBRID_TRANSPARENCY_BATCH_PARTITIONING, but without it, is weird.

The reason is that transparent entities are split into different batches using the HybridBatchPartition shared component, which is added automatically at GameObject conversion time if the Material on the MeshRenderer is determined to be transparent, unless DISABLE_HYBRID_TRANSPARENCY_BATCH_PARTITIONING is defined in which case it is not added. If you change the Material at runtime, the HybridBatchPartition will still remain.

You can remove the HybridBatchPartition shared component when you change the Material to make HRV2 batch efficiently again. You can do this regardless of whether the Material is transparent or not, but if you do it with a transparent Material, then incorrect looking rendering can result if objects are on top of each other in the view.

1 Like

well I guess this awsome, is there any component to stop rendering an object? like disabling rendering?
Maybe a “Disable” tag component?

Yes, there is a tag component called “DisableRendering” which does exactly that. Any entities with that component should be efficiently skipped by the Hybrid Renderer.

1 Like

Cool thanks a lot for your help!

1 Like