Search Unity

Setting Material Colour for Entitiy

Discussion in 'Entity Component System' started by kneave, Apr 21, 2020.

  1. kneave

    kneave

    Joined:
    Aug 14, 2014
    Posts:
    17
    Howdo,

    I've been working to implement a point cloud system using DOTS where the values of the various points are represented by colour, it seemed like an ideal fit from my understanding. Though I'm now able to render cloud points for the life of me I can't figure out how to change the colour of them.

    The prefab is a sphere with a material on it, I can see that the property is changing on the entities when I run this code:

    entityManager.AddComponentData(myEntity, new MaterialColor
    {
    Value = new float4(1,0,0,1)
    });

    However I the colour remains as per the original entity. Can anyone suggest where I'm going wrong please? I keep feeling like I'm getting the hang of DOTS then something like this really trips me up :/

    Thanks,
    Keegan
     
  2. thebanjomatic

    thebanjomatic

    Joined:
    Nov 13, 2016
    Posts:
    36
    Which rendering pipeline are you using?
     
  3. kneave

    kneave

    Joined:
    Aug 14, 2014
    Posts:
    17
    I have installed the Hybrid Renderer package but I'm not sure if I'm actively using it if I'm honest. Is there a setting to switch for it or if I was using one explicitly would I know about it already? Sorry for the rookie questions, I've been using Unity a long while but not at this level I'm realising.