Week 5 Day 1 - Dynamic Materials and Water
Today we continued our discussion of materials in UE4, learning about dynamic materials that have parameters that can change. The process works like this:
1) Make a material, but anything you want to have changeable, use a parameter (either a vector parameter or a scalar parameter) instead of a constant.
2) After you finish the material, go back to the content browser, right click on the material and choose "Create Material Instance". This will allow you to create a new material based on the original material, but with different values for the parameters.
3) Double click the instance, and check the checkbox for any parameter you want to change. If you set min and max values for the values, you can slide the values around within the range and see how it looks in the editor window.
It's common to make one "master material" that handles whole classes of materials, like for say metals, and then make instances of it for gold, brass, silver, etc., without having to remake a cool metal material each time.
I showed a material I made last semester that allowed the metal to rust, become pitted, get smoke covering it, get blood sprayed on it, etc., dynamically in the game. The materials I made today were all deliberately garish by contrast.
The second thing we talked about was water (which we will continue next time) and did the simplest way of making water in UE4 by just using a plane, and turning off collision so the player can fall through it. A plane with a landscape intersecting it makes for easy but still kinda interesting looking water. A little movement on the plane can make a cheap but nice water animation.
If you want to change the color of the camera underwater, you can either add fog, or you can add a Postprocess Volume to the underwater area, which can do things like changing the scene color to blue, adding film grain, adding a Vignette effect, and so forth, to drive home the fact you're under water. A physics volume over the same underwater area can turn on water physics.
Other Videos By Bill Kerney
2021-02-18 | Week 6 Day 2 - Range Based Loops in Assembly |
2021-02-17 | Week 5 Day 1 - Invalid / Valid / Sound Arguments II |
2021-02-17 | Week 6 Day 1 - C++ Trivia: Const |
2021-02-16 | Week 6 Day 1 - Water and Landscapes III |
2021-02-16 | Week 6 Day 1 - Midterm Review and Generations of Architectures |
2021-02-12 | Week 4 Day 3 - Invalid / Valid / Sound Arguments |
2021-02-12 | Week 5 Day 2 - Dynamic Materials II - Water |
2021-02-11 | Week 5 Day 2 - Syscalls |
2021-02-11 | Week 4 Day 2 - Fallacies Part 1 |
2021-02-10 | Week 5 Day 2 - Linked List II |
2021-02-10 | Week 5 Day 1 - Dynamic Materials and Water |
2021-02-09 | Week 5 Day 1 - GDB and 2D Arrays with ARM32 |
2021-02-08 | Week 4 Day 1 - Scratch Part 2 |
2021-02-08 | Week 5 Day 1 - Linked Lists |
2021-02-06 | Week 3 Day 3 - Scratch |
2021-02-05 | Week 4 - Tracelines and Bounding Boxes |
2021-02-05 | Week 4 Day 3 - TDD and Linked Lists |
2021-02-04 | Week 4 Day 2 - UE4 Materials |
2021-02-04 | Week 4 Day 2 - Embedded ASM and Name Mangling |
2021-02-04 | CSCI 1 Week 3 Day 2 - Moral Frameworks |
2021-02-03 | Week 4 Day 2 - Big O Notation |