Hybrid Rendering package becomes Entities Graphics
Entities Graphics
The Entities Graphics package, previously known as Hybrid Renderer, provides systems and components for rendering ECS entities. It is a system that collects the necessary data to render ECS entities, and sends this data to Unity’s existing rendering architecture. With Entities Graphics, users can continue to use familiar workflows via Unity’s Scriptable Render Pipeline (SRP), including Universal Render Pipeline (URP) and High Definition Render Pipeline (HDRP), to author content and define rendering passes.
Rationale to rename to Entities Graphics
The hybrid rendering package “com.unity.rendering.hybrid” is now “com.unity.entities.graphics”, and the package will be referred to as “Entities Graphics” in the documentation.
In ECS for Unity 2022, we decided to go for more consistent naming in some packages. In particular, we found that users were often confusing “com.unity.rendering.hybrid” as an additional rendering pipeline, which was not true. Additionally, the name is more consistent because “com.unity.entities.graphics” contains code to draw what the “com.unity.entities” package produces.
How?
In ECS for Unity 2022, “com.unity.rendering.hybrid” still exists but is an almost empty package. It just contains a dependency on the new “com.unity.entities.graphics” package. So if you open your project, “com.unity.entities.graphics” will be downloaded automatically, and you don’t have to do anything. Just know that “com.unity.entities.graphics” contains the code to draw entities. “com.unity.rendering.hybrid” is now just an empty package to ensure a smooth transition.
Do I need to refactor my code?
If your project previously used “com.unity.rendering.hybrid”, you don’t have anything to change in your code.
You may have to rename some classes if you are using some hybrid rendering classes or structs in your own custom code. As a rule of thumb, any “Hybrid” in class/struct/enum has been replaced with “EntitiesGraphics”. For instance “UpdateOldHybridChunksJob” is now “UpdateOldEntitiesGraphicsChunksJob”
Future Plans
Moving forward, the “com.unity.rendering.hybrid” package will be completely removed. Only “com.unity.entities.graphics” will remain. We strongly encourage you to add the “com.unity.entities.graphics” package to your project during the transition period via the package manager or directly modifying the manifest.json. Doing this will prevent you from getting some errors about missing code when the old “com.unity.rendering.hybrid” will be completely removed.
Existing Platform Gaps
The Entities Graphics package currently does not support WebGL due to the lack of compute shader support on WebGL. Since WebGPU will support compute shaders, we are currently exploring WebGPU platform support, and Entities Graphics compatibility after. For users looking to use the Entities package and build towards WebGL, users will need to bridge ECS data to GameObjects, and render GameObjects to WebGL. We are planning to provide users with samples and documentation on how this can be achieved in future releases.
BatchRendererGroup API
You may have heard about BatchRendererGroup (BRG). BRG is an API for high-performance custom rendering in projects that use SRP and the SRP Batcher. BRG is the perfect tool to:
- Render ECS-based entities.
- Render a large number of environment objects where using individual GameObjects would be too resource-intensive.
- Render custom terrain patches.
Currently, the Entities Graphics package culls all the entities in a scene and generates the right Draw Commands for the frame using BRG. The package also uses ECS-based fast chunk state change mechanism to upload the minimum amount of GPU data per frame properly. Useful to note, BRG can be used independently of Entities Graphics, to achieve high-performance custom rendering.
We look forward to hearing about your experience of working with Entities Graphics and BRG.