Search Unity

Cant set Shader float array values since 5.3.1

Discussion in 'Shaders' started by battou, Jan 18, 2016.

  1. battou

    battou

    Joined:
    Jan 25, 2011
    Posts:
    222
    So I used to make float array[10] in shader and seting it's values using Shader.SetGlobalFloat("array"+i.ToString(),value) method. But in 5.3.1 it's not working. Is it expected, or it's a bug? Arrays of float3 are working though. 0_o
     
    Last edited: Jan 18, 2016
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Sounds like a bug. File it, and add details on which platform etc. it happens.

    By the way, in 5.4 there's "native" support for float arrays without the need for setting each entry individually.
     
  3. JonPQ

    JonPQ

    Joined:
    Aug 10, 2016
    Posts:
    120
    digging up old thread. but in ShaderGraph... I had same issue, until I realized its not the propertyname, but a second Reference name in ShaderGraph's Property settings you need to use. you can just rename those to match the property name as long as they are unique