Search Unity

Render complex 3D meshes with pure ECS

Discussion in 'Graphics for ECS' started by MagicianArtemka, Jun 1, 2020.

  1. MagicianArtemka

    MagicianArtemka

    Joined:
    Jan 15, 2019
    Posts:
    46
    Hi
    I'm interested in how can we render complex meshes (meshes with many parts and many materials) in pure ECS. I try to use RenderMesh component, but the result you can see on the screenshot (there needs to be a car model like you can see on the background).

    Code that I use
    Code (CSharp):
    1. _entityManager.SetSharedComponentData(newCar, new RenderMesh
    2.             {
    3.                 mesh = carMesh,
    4.                 material = carMaterial
    5.             });
    upload_2020-6-1_14-2-6.png

    So, my question is:
    1. How can I get mesh and materials from the FBX model that been imported into Unity?
    2. How can I get mesh and materials from the prefab (only mesh renderer component, I don't want to convert prefab to an entity, I just want to copy prefab appearance to my own entity)?
    Thank you very much for the help