Vertex Animation Basics in Shaders using World Position Offset (UE4, valid for UE5)
Вставка
- Опубліковано 7 лют 2025
- In this video I go through some basic animation logics, very useful to animate 3D models directly in the shader.
The main topics touched are Translation, Rotation, Scale, Complex Movements, Timings.
At the end of the video there's a bit of discussion about the strengths and weaknesses of this animation approach.
Discord: / discord
Patreon: / visualtechart
Very useful tutorial. I appreciate how you brought multiple WPO-related concepts together in a succinct and focused presentation. This makes a great resource not only for those learning the techniques but also as a quick refresher for those who've done this before but not recently enough to remember offhand. :)
Nice! Controlling the timeline in shaders is such an ignored topic and it can be really useful not only for vertex animations but for all types of data. Thanks for your explanation!
Nice video. Using this technique I have seen some mind blowing animations which were substituted for crowds of NPC's. Rather than them having bones, they have vertex animations that somehow still had really nice walk/ cheer/ sigh/ run/ conversation and gesture animations. To me, that was just straight up black magic
That's one step further, you bake the vertices position on a texture and you use it to reproduce the animation :)
@@VisualTechArt do you know how to do this?
Yes :D but you can also find some tools around for that
@Visual Tech Art I will look into, I've spend hundreds on third party tools for unreal and blender so far haha I do enjoy playing with them
Most impressive, well served.
Thank you for this! This is easy to understand and very useful, especially for VFX!
This is a great video, golden learning material : well done you've won a subscriber
so much info in such a short video! so cool!
Good stuff! Also really valuable note about the mesh bounds
;) I also forgot to mention that the same thing is true for physics collisions, of course
This is educational! Thank you for your sharing!!
fantastic tutorial - thank you :D
This is a revelation to me: animate Mesh with the Shader.. wow! thanks for sharing that, you show it in a very clear and simple way!
You saved me!
thank you for this tutorial! You may saved my school project as I have been hand-animating a leaf in the wind and it has been painstaking haha I'll try this out tomorrow, I think just simply animating the translation and rotation in the shader as the leaf moves along a spline should work no? I'm wondering though, after hearing your summary at the end, if my textures would break?
That will take some work but it can be done :)
Otherwise you can come up with a wind movement approximation that you just apply to the whole mesh
@@VisualTechArt I did actually get that to sort of work! 👍 However, I have a problem that when I move the mesh to a certain location then the rotation becomes chaotic; which must have something to do wit the World Position part of the shader but I cannot think of why that is.
Even at minuscule values the rotation is default wacky
Wow !
This video is most valuable through the deep knowledge of 3D rendering algorithms. i know nothing. Since 2005 i use DCC 3D softwares asa hobbyist, MY guess is after using UE the RGB is XYZ. And what is happening in 3D animation is Maths calculated like in this material example. The 3D animation calculations each part is a Time rooted material flush on screen. That's my guess. Sorry for bad english and noobness. Regards.
Great video!
Thank you so much!
this is gold
Quick question, when you're wiggling the character at 3:09, is there a way to manipulate the center of the mesh as well? I'm trying to figure out how to sort of animate a snake using materials and this seems like the closest method, but I'm struggling to figure out how to make the center of the mesh move...
Well yes, you just figure out a function that changes those values too
Thanks so much for this video! I'm running into something where I am rotating along Y axis in the same way you set it up in this video, but if my asset is rotated at all my rotation goes completely wonky, is there anyway I can keep this kind of motion that I generate at rest position constant while my asset transforms/moves around?
You have to be careful in combining transformations in an order that makes sense :)
maybe u can help. do u know how to blend between animations in vat textures. like blendspace in anim graph
With a lerp between the two wpo? What did you try already?
@@VisualTechArt I actually just found a way to calculate frame from previous animation and yeap, blend between 2 WPO with help of AnimToTexture native plugin :)
Amazing job like always. Do you know in this cases why I have in the version 5.x has artefacts in the shadows event the shadows not is dynamic?. Do you think that the problem is something of lumen and nanite world?. More problems with the normal representation when I create dynamic movements using mathematics. Example: Waves in a plane moving the vertex position with a shader. Or using vertex animation texture the shadows not is working well and the normal of this assets have bugs. However when I use this methods In the version 4.x I have not problems.
Not sure tbh, I should check.
But yeah, it's probably something related to VSM update, lumen and so on :)
i was woundering if its possible, to make attritions from the mesh for fake furr, like the one on ds1 sif and priscilla .
wher it feels like they inflated the mesh via shader and applied alpha map to it.
I think Acerola has a video exactly on that tech :)
In that case you render the mesh multiple times, and each time you inflate it a bit more and make it transparent with the fur map
Great video, what would you need to do to make some parts of the mesh more affected by the animation than others? Thank you
Use some gradient as 'weight' for the animation :)
@@VisualTechArt That's great to know, thank you man 👍
Really enjoyed this and learned a lot - Thank you - How would you add any easing control to vertex animation?
For that you need to modify the animation gradient with some smoothing function or curve :)
@@VisualTechArt I've figured it out using squared ands square root alpha value and stacking those or smoothstep nodes for varying easing controls. whoop!
Is there a way to "animate" the vertex colours via shader tho? For instance in dense meshes, to add some world-space noise variations of the colours (doing it at vertex level instead of pixel level)
You can't write the Vertex Colour attribute from the shader, but you can do stuff in the Vertex Shader and pass the result to the Pixel Shader. Just use a Vertex Interpolator node to do that.
You can watch my very first video on this channel, it briefly explains that :)
@@VisualTechArt Thanks, I'm going to have a look! I mean, in HLSL you can set them in the Vfrag - I could do it in Unity but I'm not fully sure how it translates in Unreal
can this be used to morph a mesh like clothing with a cloth sim assigned to the mesh
Why not :)
@@VisualTechArt okay because I was having a difficult time. Exported a point cache animation (baked) of the pose morph in cinema 4d to transfer to unreal. (I had to try baking because I can see for example, 3ds max has an unreal engine vertex animation tool. But the exported file from that is exr and a bitmap. But I can't seem to find something similar for cinema 4d. As once I assign a cloth sim to the mesh the morphs no longer work on the simulated area.
My bad for the long explanation, but if you have any way to nudge me in the right direction it will be awesome. As I don't want to use a skeletal rig control on a cloth and animate the motion with jiggle physics. Or it maybe best to use rban . As the clothing item is kind of like a puncho. Please help. Thanks
Just found Animtotexture.
how would you animate vehicles using this method? Is it even possible? Im making RTS and skeletal meshes have high cost and having hundreds of them is not an option
Well it depends on how you want to animate them, that would be an interesting experiment I think
I want to see deforming meshes when hit
How to prevent Volume Preserving Scaling from translating the mesh as well?
What do you mean?
interesting!
Thank you for your video! But I have a question torturing me for a long time. I'm making RTS game, and to make it more performant I rotate the turret using WPO, and making barrel move using WPO as well. I also make buildings like this. The problem is that I want to understand how get mesh orientation CONSIDERING current world position offset. Because some animations break as I need to consider all previous rotations when I connect something to NormalizedRotationAxis. Or, as another example, when I move the barrel of my tank, but the turret has already been rotated by "Rotate about axis" node and barrel moves incorrectly. Could you please share your knowledge on how to do things like that. Someone on UE4 forums called that heirarcal WPO movement/rotation. I'd be happy if you could help!
I'm not 100% sure I understood your problem but we can have a chat about that on my Discord? Seems like a fun problem to solve and definitely tech art related! :D
@@VisualTechArt somehow my reply is getting deleted, but I would love to. How can I find you on discord?
@@VisualTechArt my ID is Soberhead (Паша) 6103
It's in every video description!