Week 5 Day 1 - Dynamic Materials and Water

Channel:
Subscribers:
2,750
Published on ● Video Link: https://www.youtube.com/watch?v=dgFmfG0v7SU



Duration: 1:23:45
60 views
0


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.







Tags:
is50a
game development
ue4
water
dynamic materials
material instances