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
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?
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.
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.
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.