MaterialProperty Components are not working on both HybridRenderers V1 & V2

Hello Everyone,

im not sure why but adding the MaterialProperty Component is not working on both HybridRenderers V1 & V2.
im using the official MaterialColor class from the hybrid renderer package.

Thank you!

probably going to need a bit more info than that

unity version, the render pipeline, the shadergraph you're using, etc

1 Like


im using :
Unity 2019.4.3f1
Universal Renderer Pipeline
SimpleLit

So the overrides only work with V2 and V2 only works with 2020.1+ and srp 9
Is that how you tested it?

https://docs.unity3d.com/Packages/com.unity.rendering.hybrid@0.4/manual/index.html#hdrp--urp-material-property-overrides


im using
Unity 2020.1.0b16
im using the Latest URP version 9.0.0-preview 35
hybridRendererV2 (0.5.2) is enabled, ( this line is debuged each time close the subscene Hybrid Renderer V2 active, MaterialProperty component type count 53 / 128 )

i just found new things

1) the component MaterialColor is using the "_Color" shader property which is deprecated also when i try to see if this component is correctly added to the entity by filting them inside the Entity debugger, it seems like the component is duplicated.

2) i created my own MaterialColorPropertyAuthoring using the new shader Property "_BaseColor" . but for no reason this one is not being added to the Entity in the Conversion workflow.
Note the same authoring script correctly adds the MaterialColorProperty cd to the entity in Unity 2019.4

[Serializable]
[MaterialProperty("_BaseColor", MaterialPropertyFormat.Float4)]
public struct MaterialColorProperty : IComponentData
{
    public float4 Value;
}

[RequireComponent(typeof(Renderer))]
public class MaterialColorPropertyAuthoring : MonoBehaviour, IConvertGameObjectToEntity
{
    public Color color;

    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var colorProperty = new MaterialColorProperty { Value = new float4(color.r, color.g, color.b, color.a) };
        dstManager.AddComponentData(entity, colorProperty);
    }

}