Це відео не доступне.
Перепрошуємо.
Intro to Materials: Dynamic Material Instances cont. | 10 | v4.0 Tutorial Series | Unreal Engine
Вставка
- Опубліковано 19 сер 2024
- Continuing from the previous video, we now show how to make a Dynamic Material Instance that randomly changes our Class Blueprint's color. Note that this video combines both Material and Class Blueprint techniques.
A link to the wiki for further notes is available here -
wiki.unrealeng...
(00:05) - Intro and Making A Dynamic Material Instance
(03:13) - Changing the Cushion Color
(06:33) - Making the Cushion a Random Color
(08:20) - Testing
7yrs already ,still can learn a lot as a beginner. Thank you!
Now i know how to make a LSD simulator.
I love these tutorials, they are educating and entertaining at the same time. Nice work! And it is just amazing how easy this stuff is. I'm just a beginner but I already love all those features, especially the graphical way of programming things.
Still the best tutorials in 2021. With UE5 coming up Unreal should make new one massive playlist for beginners. I don't even know why Unity even exists and has big community if unreal is far better. I learned things in a week which took me 2-3 months in Unity to learn same things and to get working which I never properly understood till this day.
blueprints are awesome, just great time saver in many ways
sooooo simple ??? I luv this engine ^-^
I just want to throw something in here: I'm using the latest Unreal Engine (4.14.3) and when trying to follow this tutorial got stuck where the material wouldn't update at all.
Caveat: I was using an imported custom mesh that had two materials on it, so if that's the reason this didn't work as indicated I'll accept that, but for anyone else stuck:
I had to add an extra step into the construction script that assigned the dynamic material instance as the new material to the object. Basically, drag out from the "Set" node at the end of the construction script and insert into a "Set Material" node, with the original mesh object (chair, in the tutorial's case) as the target, and the appropriate material index as needed. Once I did that, I saw all the dynamic changes I was expecting.
Thanks
this UE4 is best, this tutorial also is best, you can understand everthing very good and its not fast like other tutorials , u4 is future !
Thank you so much you have no idea how desperetaly I needed this
Check my last posted video on this topic, as apparently MIDs are not needed, which is VERY strange. I also made a forum ticket (link in its description). It's beyond me why this works, as the official documentation says you absolutely need a MID in order to control things during gameplay (at runtime), but it works not only by using a MIC instead of MID, but even without using any MI at all, just by using the Material itself 🤯. It's beyond me why, as it completely invalidates Material Instances altogether, not to mention the Constant vs. Dynamic difference.
just finish your 10 Video! thank a lot!
Outstanding !
Wonderful tutorial, thanks a lot!
Excellent, GG!
probably no one will see this soon, but I'm going to try my luck
I've done everything you said step by step and i didn't receive any error, however when I don't see any changes when I play my level so any guess what could be the issue
한글 자막 덕분에 끝까지 봤네요! 감사합니다
Thank you for the tip!
For different meshes ... we can't use this method .
I think we should use a parameter collection instead of the normal scalar param.
so informative, thnx, it helped me a lot :D
Any chance of you guys to release a Cel Shading material tutorial?
I saw some discussion and documentation about it, but I'm still having some trouble with that.
How can I make the color will be selected by the player ?? Know any tutorial?
How can I create a smooth transition between the colours?
Owen Prescott lerp?
+Owen Prescott That might involve timeline or matinee since you want to make a change happen over time instead of instantly.
There might be a timer of some sort available in blueprint. I don't know just yet.
+Owen Prescott I was able to do it using a Timeline and Lerp. You might need to create a variable and set its value right after the collision event to the random linear color we created, after that you get the vector param value "ColorSeats" from the "DynamicMaterial" (this is the current color) then you connect to a Timeline. In the timeline you create a float track, do your curve where the value from the initial and end keyframes goes from 0 to 1. You get this value from the timeline and LERP with the color we got (the current color), the alpha channel should be the output of the timeline (the float that it outputs from 0 to 1), then for every frame (update) you connect and set the vector param of our dynamic material instance to the result of the lerp.
+devtodev herp, derp.
+Owen Prescott I'm sure you've already figured out how to do this by now, but thanks to +kuinks' comment below, and with a bit of tinkering, I was able to make it work. Here's the steps in case anyone else is interested:
1. In the event graph, drag in a reference to your Dynamic Material (which was already created in the tutorial in the construction script) and select Get.
2. Drag a wire off of that and start typing GetVectorParameterValue and select it. Change the Parameter Name to ColorSeats
3. Connect the executable pin from Event BeginPlay to exec in of GetVectorParameterValue. (If you've deleted Event BeginPlay, just right-click and search for it to add it back in.)
4. Right click on the dark blue Return Value pin of GetVectorParameterValue and Promote to Variable. Call the variable LastColor. This setup will ensure that the 1st transition of the chair color that happens the 1st time the box is entered will behave the same as all the other times.
(Now some of these nodes you may already have setup in your graph if you've been following the tutorial, but I'm giving everything in a step-by-step layout, so here we go...)
5. With the box collision component selected, add an OnComponentBeginOverlap Event (either by right-clicking or by clicking the corresponding green button in the Details panel under the Events heading).
6. Drag in another reference to your Dynamic Material and click Get.
7. Drag a wire off of that and start typing SetVectorParameterValue and select it. (Note this is a SETTER not a GETTER!) Change the Parameter Name to ColorSeats. Plug the exec pin of OnComponentBeginOverlap into the exec in of SetVectorParameterValue.
8. Right click and add a Random Float in Range node. Set the min to 0 and max to 1. Copy and paste twice, so now you have 3 copies (one each for Red, Green, and Blue).
9. Drag a wire off of the Return Value of the 1st Random Float in Range node and type MakeColor and select it. Connect the Return Values of the other two Random Float nodes to the G and B pins on the Make Color node.
10. Take the dark blue Return Value of the Make Color node and plug into the Value pin on the Set Vector Parameter Value node.
11. Now right-click on the Return Value of the Make Color node and Promote to Variable (so we can store this value), and call it NewColor. Plug the exec out pin of SetVectorParameterValue into the exec in of NewColor.
12. Right click in the graph and search for Timeline and select it.
13. Double-click the Timeline to open it. Add a new float track by clicking the appropriate button. Call the track ColorTransition.
14. Shift-left-click in the timeline twice to add 2 separate keyframes. Select 1st key and set Time to 0 and Value to 0. Select 2nd key and set Time to 1 and Value to 1. This will create a 1 second transition between colors.
15. Go back to the Event Graph, and plug the exec out of NewColor into the Play from Start pin of the Timeline node.
16. Now border select your Dynamic Material reference and SetVectorParameterValue node and copy and paste them. Plug the Update pin of the Timeline into exec in of SetVectorParameterValue.
17. Right-click and add a Lerp (Linear Color) node. Ctrl-drag out your LastColor and NewColor variables to get a Getter of each. Plug LastColor into the A of the Lerp, and plug NewColor into B.
18. Plug the green Color Transition pin of the Timeline into the Alpha pin of the Lerp.
19. Plug the dark blue Return Value of the Lerp into the Value pin of the SetVectorParameterValue node you just pasted a moment ago.
20. Now we need a way to again "Set" what that LastColor is, so we can ramp between it and the NewColor each time we overlap the box. So with the box collision component selected, right-click and add an OnComponentEndOverlap (or by clicking the corresponding green button in the Details panel under the Events heading).
21. Now go back to your Event BeginPlay node area and border select the Dynamic Material reference, GetVectorParameterValue, and Set LastColor node. Copy and paste them beside your OnComponentEndOverlap event. Plug the exec out pin of OnComponentEndOverlap into the exec in of GetVectorParameterValue.
22. Now compile and save, and hopefully you should see the desired result. :-)
How would I switch it back to the original material on end overlap?
What I want to know how to do is to randomly change the material of the mesh itself. Either to a random material from all the materials the project contains, or a random material from a select few choices.
Can this be done on a skeletal mesh that spawn in from a spawner? I tried this on my skeletal mesh, but each time it spawns in, it's always the same colour.
Dynamic materials looks challenging a little but can you also have some type of statue with a colored hat change his hat colors and also fire a different weapon at you every time you get close?
Yes. For more information, take a look at blueprints.
The Blueprint videos on the Unreal Engine 4 website?
yes. They do a whole lot of stuff with it. they don't describe your exact instance, but I'm positive that blueprints have what you need. also, if you are subscribed to UE4 already, download their new Blueprints demo.
amazing - 2020
How can we use dynamic materials for instanced static meshes without having the same material for all of them?
Is there any way to let the player change textures manually
for example you have wall click on it and gives you lots of options to change texture and a colour picker menu
1 Video for how make Photorealistic Landscape/Material !! ?? PLS :)
So I'm having a bit of an issue. I would like to trigger a dynamic material instance on an mesh. Where I want my trigger and where I have my mesh are separate. I need the trigger on the other side of my level to activate the material instance change on the mesh. How would I go about that?
is it possible to change an entire material in a scene with a blueprint? not just a material applied to a part of a chair. So say I had 20 tables and 10 chairs all with the same material on them would I be able to dynamically change all their materials at the same time or would each object have to have their own blueprint with a dynamic material linked to that trigger?
Can I return one of 6 textures at material editor ? That will not have any trigger. just will return one of given data. Then when I add a new mesh material will return a random texture ? Note that I want to do it in material editör.
Hi! Can I Change texture like this? for example a paint with human face become to skull in approach? How?
How would i animate overtime? I am trying to make my param play for 5 seconds
sir, how about select object pop up menu pick material .blueprint
9:30 Why we don't have debug features like this inside the engine? It would be great
Actually the engine remembers the position and scale of the viewports when you set them and you can also set custom size if you click the arrow beside the play button and hit advanced settings.
Is there extension for the materials tutorial? This was for beggines, is there advanced tutorial for example?
Awesome tutorial, but can you do something like this from a Level Blueprint as well? Example: I want to press a button placed in the map that will change the material settings of a mesh. Is that possible? o.o
+AshikawaBetas You probably wouldn't do that with the level blueprint, you'd do it with the button's blueprint and the mesh's blueprint
Has anyone changed Texture dynamically?
+devtodev Yes, it can be done in C++
+Dan Toškan It can be done in bp. I have done
Could anybody do it?
Yes, I did it
Yeah it's actually pretty much the same. 1) Create a material which has a CustomTexture parameter (the chair doesn't have a texture). 2) create a blueprint that uses the Set Texture Parameter Value Node to change the texture. In my example it changes a mesh from rusty metal to alumin(i)um: imgur.com/a/8R6hi
Is it possible to use this kind of a method to change a specific part of a material?
Say for instance change the roughness or change the emissive properties?
To change the roughness of the seat:
1. Select the "Dynamic Material" node that we already created
2. Drag out from it and create a "Set Scalar Parameter Value" node
3. Set the Parameter Name to "RoughnessSeats"
4. Drag out from Value and create a Random Float
5. Connect the "exec" (The white arrow) of this node to the white arrow of the other "Set Vector Parameter Value" node
6. Compile & Save
Finished: i.imgur.com/C9Voz2g.png
Etillion Ah ok thanks. I'm somewhat new to UE4 after moving over from Cryengine and I'm looking to set up some Daleks, this method should help with having the head lamps light up.
Thanks for the help, one last thing, in UDK it was possible to project a image camera onto a plane which gave a portal like effect, is this still possible in UE4?
I believe it's a method called "render camera to texture".
I've looked up tutorials but the stuff shown in UDK don't seem to be there in UE4.
Cobby Ah yes, you mean like security camera monitors? You can see that in action in the "Blueprint Office" sample in the Marketplace. You are gonna have to figure out on your own how to use it.
Etillion Ah good so it's still there.
Thanks.
Etillion You're awesome.
How to make dissolving materials or transition from opaque to transparent?
***** Create a random Alpha value I think
***** Create a random Alpha value I think
jolanpiep now I am master in this :)))
+Jānis Grīnvalds where else did you use to learn after finsihing all unity's tutorials?
this is unreal engine not unity
I want your babies! Thanks for the awesome tutorials :)
wat...
@@FabstaPizza there were very few tutorials out there when I posted this. Offer still stands!
@@CharlieRawlinson no... the first bit....
Looks like that random generator has a propensity to generate sea foam green colors lol
how do you make this with objects that are not static? like animations?
I'm wondering this. I have a skeletal mesh, and would like it to be a random colour every time it spawns in from a spawner I made. I followed this video but the colours don't change.
Why do the random numbers have to be 0-1?
RGB goes 0-255
Base 100 so 255 would be 1 (100%) and by example 128 would be 0.5 (50%)
ok, thx :)
Yeh, they are just normalized.
More specifically in shaders if there something with range of numbers they are operated on float points between 0 and 1 so they can be scaled to any hardware
Personally I would have preffered if they did it out of 100. Can you change that?
Why does he keep bringing in things as "getters", but then goes on to say that we are going to be "setting" some value on them? Why wouldn't we bring it in via the "Set" option if we're going to be mutating it?
For those of you that have a similar query, I believe we are "getting" the reference into our namespace so that we can pass it as input to function, so it actually does make sense.
he says getter because it is getting a reference to that selected variable, you have to reference something if you want to set something otherwise how would a setter know to which variable you are setting the value to.
Hi!! Is it possible to change the material (texture) instead of the color? It would be great!!