ECS (DOTS) Created mesh not visible

Trying to use Unity ECS DOTS, but getting following message in a console:

“No SRP present, no compute shader support, or running with -nographics. Hybrid Renderer disabled”

Unity version: 2021.3.9f1 LTS

When creating an entity with mesh from the code, I see no cube. But the Entity with valid components is present:

public class Creator : MonoBehaviour
{
    public Mesh mesh;
    public Material material;
 
    private void Start()
    {
        EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
        EntityArchetype archetype = entityManager.CreateArchetype(
            typeof(Transform),
            typeof(Rotation),
            typeof(RenderMesh),
            typeof(RenderBounds),
            typeof(LocalToWorld)
        );
        Entity entity = entityManager.CreateEntity(archetype);
        entityManager.AddComponentData(entity, new Translation()
        {
            Value = new float3(2, 0, 4)
        });
        entityManager.SetSharedComponentData(entity, new RenderMesh()
        {
            mesh = mesh,
            material = material
        });
    }
}

Yes mesh and material variables are set correctly.

I also tried to create a simple scriptable render pipeline asset and assign it in Graphics settings via this tutorial, but no help. Any idea what could be the issue?

Package versions:
8433188--1116968--upload_2022-9-12_15-36-6.png

This isn’t the DOTS forum. The forums for that are here.

I can move your post to one of then if you wish.

Yes, please do :slight_smile: And if you can, please also fix the typo in the title “create” into “created”

1 Like

Done and done. You didn’t say which sub-forum so moved to the root one.

1 Like

Create a cube game object in the hierarchy.
Remove the collider and enable convert to entity.

Compare your entity with the cube.
Any missing component ?
Are all values set to something sensible ?
Maybe you have a render bounds set to a zero sized cube.
Also check the render system in the systems widow to see which components it expects.

Use RenderMeshUtility instead: Runtime entity creation | Hybrid Renderer | 0.51.1-preview.21

2 Likes

Hybrid Renderer is only compatible with HDRP and URP, not built-in.

3 Likes

This works, big thanks Luxxuor!

Also, I presume that ECS mesh rendering won’t work without either URP or HDRP?

This works for me thanks a looooooooot!!! Not sure why below code won’t works.
//entityManager.AddSharedComponentData(entity, new RenderMesh
//{
// mesh = enemyMesh,
// material = enemyMaterial
//});