Search Unity

Arrays - Can I have arrays with GPU Instancing

Discussion in 'Shaders' started by Modernllama, May 8, 2017.

  1. Modernllama

    Modernllama

    Joined:
    Nov 30, 2012
    Posts:
    19
    Hi,

    Wanted to ask whether I can use arrays with GPU Instancing? For example, rather than use textures at the moment to represent damage or bullet holes on an object, I'd rather use a float array which has a value per pixel. Changing this at runtime would be much quicker.

    My understanding however is that MaterialPropertyBlocks can only affect either properties or uniform values. And since you can't declare an array as a property and I need the values to be different for each individual, my hands are tied. Is that right?

    Thanks,