Search Unity

Properly Assign Material to Instantiated Entity in "Hybrid Renderer V2"

Discussion in 'Graphics for ECS' started by Ziddon, Feb 25, 2022.

  1. Ziddon

    Ziddon

    Joined:
    Feb 6, 2015
    Posts:
    27
    Hi, I'm experimenting with "Hybrid Renderer V2" and am not sure what the correct way of converting a material is.

    I should also note that my meshes are created dynamically at runtime, which is why I'm not just using the converter.

    In version 1 I would simply do this
    Code (CSharp):
    1. RenderMesh renderMesh = new RenderMesh() { mesh = mesh, material = basicMaterial };
    and the "basicMaterial" material would properly appear. In the entity inspector it looks like this:
    upload_2022-2-24_16-7-12.png

    In "Hybrid Renderer V2" my cubes are now gray.
    I have noticed that the "Convert to Entity" script gets the job done, but adds a million components XD.
    upload_2022-2-24_16-10-19.png

    Does anyone know if there's a good way of approaching this data-component-catastrophe?

    Thanks! :)
     

    Attached Files:

  2. Luxxuor

    Luxxuor

    Joined:
    Jul 18, 2019
    Posts:
    89
    Ziddon likes this.
  3. Ziddon

    Ziddon

    Joined:
    Feb 6, 2015
    Posts:
    27