Imagine a sphere containing smaller spheres of different color which are dynamically being translated within. I would like to shade the surface of the containing sphere based on the proximity of each surface primitive (vertex or fragment) to each of the contained spheres. The closer the proximity, the more the underlying color contributes to the resulting color. The specific use case constrains the number of contained spheres to be no more than 16. How do I go about this in Unreal?
Ideally, I would have liked to simply pass the contained sphere positions and colors into the shading procedure of the larger sphere and calculate the resulting color therein. My current understanding is, however, that array parameters cannot be passed into materials.
Alternatively, I thought about assigning the vertex colors of the containing sphere at run-time, which sadly, also seems to currently be impossible in Unreal.
I also have been looking into material parameter collections. Having 16 distinct sphere positions and 16 distinct sphere colors at first seemed like a possible, although cumbersome and unwieldy solution considering the simplicity of the task. I don’t, however, understand how to dynamically update these variables. Would each of my contained spheres have to have its own, unique material, writing to the appropriate fields in the parameter collection?
Any input would be greatly appreciated.