November 5th, 2020
Ben & Jace Talk: Mesh Animation vs. Material Animations (Part 1)
https://www.youtube.com/watch?v=omjFqZQV9fI&t=400
Suggested Wiki Refrence Code
Topics
Transcription
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.