Is Entity.Graphics supposed to work with URP's 2D Renderer at all?

When setting up a scene with a Sub Scene that contains any of the 3D primitives with a Mesh Renderer and a 2D Renderer is installed as default, I get a lot of exceptions and the entities are not working. I think the root cause is that the render path of the 2D renderer can’t be determined while checking if a “use the Forward+ renderer” warning needs to be shown. However, I wonder if this ever meant to be working as on one hand we’re supposed to use the Forward+ renderer while at the same time orthographic projection is not supported which I believe is used in 2D games more often than perspective. Maybe someone from the Unity team can clarify the road ahead with 2D, URP and Entities.Graphics? Thanks!

This problem occurs in Unity 2022.2.16 as well as in 2023.1.x with Entities.Graphics-1.00-pre65

Hi,

Entities Graphics only supports Forward+ in URP.

2D Sprites / Tilemap etc. are only companion components which allows you to put them in subscene and query them in ECS system. That means they are still GameObjects i.e. won’t benefit from the fast performance of Entities Graphics.

Orthographic support in Forward+ will be available very soon.

1 Like

Hi @mingwai Thanks for the info, that’s good to know. For my game I’ve got kind of a hybrid of tiles and sprites as regular GameObjects combined with Quad based custom “sprites” as entities. I would use a regular Forward+ renderer (once orthographic is available), but I also want to have the 2D lights which seem to work only with a 2D renderer. So my initially described problem with the exceptions is a blocker. Is that issue known already?

To clarify, do you mean you are using 2D Renderer for the Sprites and using Forward+ Renderer for the custom quad sprites (in this case your scene will have 2 cameras)?
OR you want the custom quad sprites entities to be affected by the 2D lights from 2D Renderer?

so far I had just one camera (and ideally would like to keep it that way) and everything, the tilesets as well as the custom quad sprites, have been rendered by the URP 2D Renderer. The 2D lights affect only the tiles and SpriteRenderers, which is fine. My problem is, that the use of a 2D Renderer in a scene that contains a subscene with Mesh Renderer GameObjects (e.g. a primitive cube or a quad) now causes exceptions and the entities are not being rendered anymore. This can easily be reproduced: Just use a blank URP project, create a 2D Renderer and set it as default. Create a sub scene in a scene and add a Cube to it. Then hit play and you will get a recurring exception

Understand now, thanks for raising the issue. I’ve made a bug report to the Entities Graphics team.

2 Likes

awesome, thanks!

Is there a workaround for this? Or should we wait until the error is officially fixed?

1 Like

Hey, the bugfix will be available in the next 2022.2 patch release (2022.2.22f1).

1 Like

Awesome, thanks for letting us know!

Update: 2022.2.22f1 became 2022.3.0f1, which is available now.

I can confirm that everything’s working again now in Unity 2022.3 LTS! Awesome

1 Like