Dynamic Material

I’m trying to create a material for a UI consisting of several ellipses, but I won’t know how many until runtime.
I’ve created a material function that can take in parameters and produce an ellipse, as an additive material.
I’ve also made a blending function which takes two sets of material attributes (ellipses) and merges them into the same material.
I can use this repeatedly to blend as many as I want, but the problem is I don’t know how many until runtime.
How can I approach this? Is this even the right idea to begin with?

For context I’m making a space game and this is for a map of the solar system.
Hopefully this makes sense!

As you called out in your title, you can do this using dynamic materials

To edit the parameters of a specific material at runtime you’ll want to convert the materials to dynamic materials (has to be done at runtime). That can be done like so:

Then, you can cast the material to a dynamic one whenever you need to change something:

1 Like