November 5th, 2020
Ben & Jace Talk: Mesh Animation vs. Material Animations
Ben & Jace Talk: Mesh Animation vs. Material Animations (Part 1)
https://www.youtube.com/watch?v=omjFqZQV9fI&t=400
Suggested Wiki Reference Code
Jace
And what are these big white boxes?
When are they coming out?
Right now.
Wow, that was a joke, actually.
But that worked out really nice.
Ben
So, the next thing I want to talk about is also materials.
So, also shaders.
With Update 3, we used...
some less skeletal meshes because they're animated mesh because they're relatively expensive, hard to deal with.
So since we're going to have a lot of pumps and flow indicators, we wanted to experiment with putting it in the material instead.
So everything is driven by mathematics.
Jace
So yeah, there's no animations built in, like
Ben
no
Jace
animator went in and did
Ben
anything.
So this is how it looks like as colors.
So the blue
controls how much it bounces.
So where it's blue, it doesn't bounce that much.
Where it's black, it
Jace
will bounce.
Oh, I see.
Yeah.
So I feel like this concept here makes sense to me, but it might not make much sense to a lot of other people.
So just to sort of break it down,
The way that you're going to be breaking up these colors here, when you say that the blue part that they can see is, that's just a marker for the material, right?
That says when it's blue, I want all the blue parts to balance on the actual animation.
Yes.
Right?
So then you've got red and green as well.
Ben
Yeah, red and green is for the pistons to know which one is which one.
Jace
Right, right.
So when those colors change, then the position of things or whatever changes.
If we quickly jump into the
Ben
instance.
We have a lot of settings to play with.
Jace
Ooh, settings.
Ben
Can increase the flow rate.
That should never go above one.
Jace
Seems fine.
Ben
Or it can increase the impact, as you can see.
Oh, yeah, yeah.
Bounce even harder.
Yep.
Reduce it.
Increase the exponent so it hits harder.
Yep.
instead of slower, because this is a bit boring, right?
Where it's just perfectly straight.
And now it's just with an ease in.
Jace
There's more impact.
It looks like it's being slammed in as opposed to smoothly being pushed in.
Ben
That's definitely what we wanted here.
We can make them go at the same time.
Jace
Are you able to change any of the colors in real time?
Oh, that's pretty cool.
Ben
The colors?
No, they
Jace
are
Ben
baked on the mesh.
Or do
Jace
you
Ben
mean the water here?
Jace
No, I meant those other colors.
So you could maybe make other parts of it pump when it shouldn't.
If the body was green, that would be pretty funny.
Ben
That's the downside of it, that it is baked into the mesh for efficiency.
Jace
That's not too bad.
I mean, you wouldn't want to do what I suggested anyway.
So it's a fair trade-off.
Ben
Yeah.
And then we can change the direction it moves.
Oh, wow.
Jace
Seems fine.
Ben
Perfectly fine.
This stuff never breaks.
Jace
Yeah, never.
That's really cool.
Okay, so we're basically shaving off a complete animation.
Yep.
And we can do that for other things as well.
And that's per instance of every pump.
Ben
Yep, per instance
Jace
of every pump.
Nice, nice.
Ben
So that's...
So now it's just three static meshes instead of three skeletal meshes that needs to be ticked, like updated by the game.
And that would just cost so much performance.
Jace
Yeah.
So skeletal meshes are often used for, I guess when they say skeletal, then they've got bones, et cetera.
So like the character or the hogs where they actually have little pieces of them that are like moving in specific ways.
So this is like a definitely a great candidate to get rid of all that unnecessary stuff.
Ben & Jace Talk: Mesh Animation vs. Material Animations (Part 2)
https://www.youtube.com/watch?v=omjFqZQV9fI&t=639
Suggested Wiki Reference Code
Topics
Ben
So the next one is...
Jace
What's the next one, Ben?
Ben
That's the HyperTube support.
I'm not sure
Jace
if many
Ben
people noticed this, but when the player gets close, it opens.
So that allows the player through.
Like in camera shutter.
Jace
Yeah, the aperture.
Ben
Yeah.
Jace
Was it not like that before?
Ben
It always was like that.
Jace
Yeah, I thought so.
Ben
Okay.
I'm just curious if people even noticed it.
Jace
Leave it in the comments below if you noticed.
I think I
Ben
noticed.
And also the lights turn green when you get close.
Jace
Oh, I didn't notice the lights turn green.
Ben
Which is also driven by vertex colors, as you can see here.
So every segment has a color which allows me to figure out which ID it is.
And that way I can move it into the right direction at the right time.
Jace
Right.
Can you close it again?
I just want to take another look at it.
Okay.
So each one of those little pizza slices have an ID, and then you just can manually control each one to go into a specific direction or location and rotation, I guess.
Let's see what this parameter does.
Ben
I think we can offset it.
Jace
Oh, okay.
Interesting.
Ben
Cool.
so we can control how it behaves.
I just like how it would be with a camera.
Yeah.
So that is another one of them.
Ben & Jace Talk: Mesh Animation vs. Material Animations (Part 3)
https://www.youtube.com/watch?v=omjFqZQV9fI&t=738
Suggested Wiki Reference Code
Ben
So that is another one of them.
Then one of the players I am going to look a lot at, the Flow Indicator, which was a really challenging one because it was really hard to,
Also do it design-wise.
Like to figure out what to do at all.
Yeah.
Because it was like, how do we tell how full it is?
How do we tell which direction it moves?
How do we tell how fast it moves?
So all those questions had to be answered.
So if we take the...
Jace
Pretty
Ben
efficient design.
The
Ben
flow rate.
Here we can see it goes that direction.
And...
the code it changes the direction negative if it goes the other way
Jace
yep
Ben
so uh yeah that's that's how we opted it for it and if it would flow less the rings just expand less like
Jace
okay so this is is this also just kind of like done with math then you're just taking the mesh yes and moving it and uh scaling it a little yeah okay
Ben
so it's all just
Jace
that's
Ben
really cool it uh works
It's like in between these.
So here you can see the mesh with the colors.
Let's go in color mode.
So the red and green is the site, how far it should be moved, which ones should be moved out when the content increases.
Jace
Right.
Ben
And then every segment of the ring has an ID in their color.
That's why the color difference is slightly different each of them.
It's hard to see, but you have to trust me on this one.
Sure.
And then I just adjust it based on the inputs that it gets from the programmers.
Jace
Yep.
So this is why you pay attention to math class, so that when you make pipes in a video game...
I'm terrible at
math.
Jace
you actually yes well there you are don't pay attention to math class it doesn't matter he just goes to uh google and looks for these solutions so yes go to stackoverflow.com and be like how do i do this and someone's like
Ben
gosh ironically most of the answers i find on the unity forms
Jace
yeah oh really yes there you are
Ben
even though uh we are using unreal but the math is universal anyway so it doesn't matter yeah yeah
Ben & Jace Talk: Mesh Animation vs. Material Animations (Part 4)
https://www.youtube.com/watch?v=omjFqZQV9fI&t=881
Suggested Wiki Reference Code
Ben
And then the last one that I just thought of is something I hope people noticed.
It's the grass.
Grass also uses vertex animation for the wind.
So maybe people notice it from update two to update three, the grass kind of changed how it moved.
Jace
It is floating, so that looks about the same.
Yeah, it
Ben
depends where you
Jace
are.
Ben
So yeah, we increased.
the visible fidelity of the grass, how they should behave.
So here, let's just make them really wavy.
So we increased the wind direction.
Particle effects also have it.
Damn.
But the problem is that we don't rotate the wind at all right now, so you don't ever see the difference.
Right, right.
We have a nice data asset for that where we can change the wind direction.
And then weather.
That's what I called it because I was innocent and I believed that I could do more in a little time.
Here's the direction.
That's pretty funny.
So let's rotate it.
Now the wind is flowing this direction.
And now the other direction.
Aw, so cool.
And now it goes nowhere.
Jace
Yay!
Yeah, it'll be much cooler once, like, this becomes more dynamic in terms of the direction.
Ben
And then we go to the next thing.
So, optimization.