How do I pass an array of values into a shader?
As the title says, I need to pass an array of values, likely floats, into a material shader. The purpose is to use those values to deform the vertices of the mesh. I've tried Material Parameter Collections, but that doesn't seem to be the most practical way to do it (imagine adding dozens of parameters to a collection manually...).
Thanks in advance!
Hey dsl -
So there is a way to do what you are wanting to do but it requires some blueprinting in addition to your material setup. In the material you should be able to setup a parameter which makes your array input type, since you are using vertex animation I would assume you are going to be setting up a vector parameter. Now in blueprints you will want to setup a Dynamic Material Instance for the object in the world that is using that material and assign the Dynamic Material to that object in your blueprint. For using the custom animation and changing the vector parameter, you can use Matinee to animate over time and set to play and loop from the blueprint or through play on level load and looping in the Matinee actor.
The one clarification that I want to make is exactly how is your animation getting imported in, because it also sort of sounds like **Morph Targets** might also solve your problem as well.
answered May 20 '14 at 03:36 PM
Lovecraft_K ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here