#list or arrays within a shader (shaderlab or shadergraph, either one is fine)

1 messages · Page 1 of 1 (latest)

daring wren
#

So i've been wondering if it's possible to make a list or array to dynamically change a collection of functions/nodes within a shader?

let's say i wanted to blend some colors together, but i wanted to change how many colors im blending with a list/array?
doesn't need to happen in play mode, but rather just to prevent a lot of clutter within the code/node editor

timid crag
#

You can use structured buffers. You can't resize them, but you can create and bind a new one and sync it with a C# list.

#

To answer your question: no, you can't resize gpu arrays or buffers and there are no lists.

opaque tulip
#

in this case, you could also use a color array – you'd need to do your own UI for this, though, as Unity doesn't provide a way to declare a color array property in ShaderLab

daring wren
#

just now saw the messages, thank you very much for the replies