Search Unity

Using instancing on HDR color causes crash?

Discussion in 'Shaders' started by xVergilx, Aug 18, 2018.

  1. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    For some weird reason when I try to define the following color:
    Code (CSharp):
    1. [HDR] _EmissionColor("Emission Color", Color) = (0, 0, 0)
    In the instancing buffer:
    Code (CSharp):
    1. UNITY_INSTANCING_BUFFER_START(Props)
    2.     UNITY_DEFINE_INSTANCED_PROP(half, _AlphaCutout)
    3.     UNITY_DEFINE_INSTANCED_PROP(half, _NormalCutout)
    4.     UNITY_DEFINE_INSTANCED_PROP(half, _NormalAppliance)
    5.     UNITY_DEFINE_INSTANCED_PROP(half4, _Color)
    6.     //UNITY_DEFINE_INSTANCED_PROP(half4, _EmissionColor)
    7. UNITY_INSTANCING_BUFFER_END(Props)
    Once I uncomment that half4 _EmissionColor line my Unity Editor simply crashes. What am I doing wrong?

    I've also tried float4 with same result.

    This is on Unity v. 2018.2.3f1
     
    Last edited: Aug 18, 2018
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Using second "Property Block" seems to be working just fine like so:
    Code (CSharp):
    1. UNITY_INSTANCING_BUFFER_START(Props)
    2.     UNITY_DEFINE_INSTANCED_PROP(half, _AlphaCutout)
    3.     UNITY_DEFINE_INSTANCED_PROP(half, _NormalCutout)
    4.     UNITY_DEFINE_INSTANCED_PROP(half, _NormalAppliance)
    5.     UNITY_DEFINE_INSTANCED_PROP(half4, _Color)
    6. UNITY_INSTANCING_BUFFER_END(Props)
    7.  
    8. UNITY_INSTANCING_BUFFER_START(EmissionProps)
    9.     UNITY_DEFINE_INSTANCED_PROP(half4, _EmissionColor)
    10. UNITY_INSTANCING_BUFFER_END(EmissionProps)