November 5th, 2020 - Ben & Jace Talk: Mesh Animation vs. Material Animations

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
Topics
  1. 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.

  2. 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.

  3. Jace

    So yeah, there's no animations built in, like

  4. Ben

    no

  5. Jace

    animator went in and did

  6. 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

  7. 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.

  8. Ben

    Yeah, red and green is for the pistons to know which one is which one.

  9. Jace

    Right, right.

    So when those colors change, then the position of things or whatever changes.

    If we quickly jump into the

  10. Ben

    instance.

    We have a lot of settings to play with.

  11. Jace

    Ooh, settings.

  12. Ben

    Can increase the flow rate.

    That should never go above one.

  13. Jace

    Seems fine.

  14. 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.

  15. Jace

    There's more impact.

    It looks like it's being slammed in as opposed to smoothly being pushed in.

  16. Ben

    That's definitely what we wanted here.

    We can make them go at the same time.

  17. Jace

    Are you able to change any of the colors in real time?

    Oh, that's pretty cool.

  18. Ben

    The colors?

    No, they

  19. Jace

    are

  20. Ben

    baked on the mesh.

    Or do

  21. Jace

    you

  22. Ben

    mean the water here?

  23. 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.

  24. Ben

    That's the downside of it, that it is baked into the mesh for efficiency.

  25. 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.

  26. Ben

    Yeah.

    And then we can change the direction it moves.

    Oh, wow.

  27. Jace

    Seems fine.

  28. Ben

    Perfectly fine.

    This stuff never breaks.

  29. 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.

  30. Ben

    Yep, per instance

  31. Jace

    of every pump.

    Nice, nice.

  32. 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.

  33. 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
  1. Ben

    So the next one is...

  2. Jace

    What's the next one, Ben?

  3. Ben

    That's the HyperTube support.

    I'm not sure

  4. Jace

    if many

  5. Ben

    people noticed this, but when the player gets close, it opens.

    So that allows the player through.

    Like in camera shutter.

  6. Jace

    Yeah, the aperture.

  7. Ben

    Yeah.

  8. Jace

    Was it not like that before?

  9. Ben

    It always was like that.

  10. Jace

    Yeah, I thought so.

  11. Ben

    Okay.

    I'm just curious if people even noticed it.

  12. Jace

    Leave it in the comments below if you noticed.

    I think I

  13. Ben

    noticed.

    And also the lights turn green when you get close.

  14. Jace

    Oh, I didn't notice the lights turn green.

  15. 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.

  16. 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.

  17. Ben

    I think we can offset it.

  18. Jace

    Oh, okay.

    Interesting.

  19. 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
Topics
  1. 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...

  2. Jace

    Pretty

  3. Ben

    efficient design.

  4. The

  5. 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

  6. Jace

    yep

  7. 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

  8. 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

  9. Ben

    so it's all just

  10. Jace

    that's

  11. 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.

  12. Jace

    Right.

  13. 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.

  14. 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

  15. math.

  16. 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

  17. Ben

    gosh ironically most of the answers i find on the unity forms

  18. Jace

    yeah oh really yes there you are

  19. 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
Topics
  1. 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.

  2. Jace

    It is floating, so that looks about the same.

    Yeah, it

  3. Ben

    depends where you

  4. Jace

    are.

  5. 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.

  6. Jace

    Yay!

    Yeah, it'll be much cooler once, like, this becomes more dynamic in terms of the direction.

  7. Ben

    And then we go to the next thing.

    So, optimization.