Equivalent "WorldVelocity" input similar to "WorldPosition" in material or material function blueprints?

Hello, I am current using the “WorldPosition” input in a material function blueprint. I would also like to have a “WorldVelocity” input to perform some operations that depend on the velocity e.g. of a moving actor.

Is there a way to do this? I would even settle on a per-vertex (instead of per-pixel) solution. I’ve use material parameter collections for other variables used by material functions, but those seem limited to just a few global variables. I can’t imagine how they could be used per-vertex, or per-pixel for that matter.

I would even settle for approximating the velocity as a difference between the current frame’s WorldPosition and that of the last frame, but I don’t know how to access both in the blueprint.

Ideally, a more accurate velocity would be based on the actor’s linear and maybe angular velocities.

Any help is appreciated. Thank you.

I’ve use material parameter collections for other variables used by material functions, but those seem limited to just a few global variables

You can pass in the velocity as custom primitive data or there must be HLSL cod for velocity. I suggest watching the Custom Material Node video by Epic.

319009-data.png

Thank you MMMarcis, that’s what I was looking for.

For others with the same question, the data can be accessed with the “VectorParameter” node in the material editor. You just have to check its property “Use Custom Primitive Data” and assign it an index.

319825-vel.png