Це відео не доступне.
Перепрошуємо.

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

КОМЕНТАРІ • 98

  • @yingbowang3068
    @yingbowang3068 2 роки тому +7

    7yrs already ,still can learn a lot as a beginner. Thank you!

  • @xcvmacloud
    @xcvmacloud 9 років тому +54

    Now i know how to make a LSD simulator.

  • @PasiX2
    @PasiX2 7 років тому +1

    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.

  • @niranjanwagh5767
    @niranjanwagh5767 3 роки тому +3

    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.

  • @RaPtOr9600
    @RaPtOr9600 10 років тому +1

    blueprints are awesome, just great time saver in many ways

  • @erionmema1
    @erionmema1 10 років тому +13

    sooooo simple ??? I luv this engine ^-^

  • @bryg427
    @bryg427 7 років тому +4

    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.

  • @2fox989
    @2fox989 7 років тому

    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 !

  • @erth8096
    @erth8096 2 роки тому

    Thank you so much you have no idea how desperetaly I needed this

  • @PixelsLaboratory
    @PixelsLaboratory Рік тому +1

    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.

  • @sosangart
    @sosangart 2 роки тому

    just finish your 10 Video! thank a lot!

  • @justnotg00d
    @justnotg00d 3 роки тому

    Outstanding !

  • @pieterdebie4162
    @pieterdebie4162 7 років тому

    Wonderful tutorial, thanks a lot!

  • @Barcode6321
    @Barcode6321 3 роки тому

    Excellent, GG!

  • @blackgoku9374
    @blackgoku9374 2 роки тому

    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

  • @amlwq1105
    @amlwq1105 6 років тому

    한글 자막 덕분에 끝까지 봤네요! 감사합니다

  • @andremoreira7237
    @andremoreira7237 3 роки тому

    Thank you for the tip!

  • @mohshar8074
    @mohshar8074 5 років тому

    For different meshes ... we can't use this method .
    I think we should use a parameter collection instead of the normal scalar param.

  • @gorannovaks
    @gorannovaks 7 років тому

    so informative, thnx, it helped me a lot :D

  • @Ka0us
    @Ka0us 10 років тому +1

    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.

  • @marlonalves6808
    @marlonalves6808 9 років тому +2

    How can I make the color will be selected by the player ?? Know any tutorial?

  • @OwenPrescott
    @OwenPrescott 9 років тому +11

    How can I create a smooth transition between the colours?

    • @deva8496
      @deva8496 9 років тому +3

      Owen Prescott lerp?

    • @GuitarSlinger2112
      @GuitarSlinger2112 8 років тому

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

    • @kuinks
      @kuinks 8 років тому +5

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

    • @izvarzone
      @izvarzone 8 років тому +2

      +devtodev herp, derp.

    • @HeavenInspiredMovies
      @HeavenInspiredMovies 8 років тому +15

      +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. :-)

  • @Melwens
    @Melwens 2 місяці тому

    How would I switch it back to the original material on end overlap?

  • @ZaneErickson
    @ZaneErickson 9 років тому

    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.

  • @Xegethra
    @Xegethra 2 роки тому

    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.

  • @LEGIT134
    @LEGIT134 10 років тому

    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?

    • @mikeshaver-miller745
      @mikeshaver-miller745 10 років тому

      Yes. For more information, take a look at blueprints.

    • @LEGIT134
      @LEGIT134 10 років тому

      The Blueprint videos on the Unreal Engine 4 website?

    • @mikeshaver-miller745
      @mikeshaver-miller745 10 років тому

      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.

  • @REZAsys2
    @REZAsys2 4 роки тому

    amazing - 2020

  • @TiramisuCorleone
    @TiramisuCorleone 5 років тому

    How can we use dynamic materials for instanced static meshes without having the same material for all of them?

  • @mohammadaminsepahi4916
    @mohammadaminsepahi4916 4 роки тому

    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

  • @pumpyourday365
    @pumpyourday365 7 років тому

    1 Video for how make Photorealistic Landscape/Material !! ?? PLS :)

  • @mattytwo-time9943
    @mattytwo-time9943 6 років тому

    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?

  • @mattymatt2323
    @mattymatt2323 9 років тому

    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?

  • @gomidasodabasioglu
    @gomidasodabasioglu 6 років тому

    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.

  • @DemiyRous
    @DemiyRous 7 років тому

    Hi! Can I Change texture like this? for example a paint with human face become to skull in approach? How?

  • @KawaiiLabsLLC
    @KawaiiLabsLLC 4 роки тому

    How would i animate overtime? I am trying to make my param play for 5 seconds

  • @johnlo8285
    @johnlo8285 7 років тому

    sir, how about select object pop up menu pick material .blueprint

  • @SurviveOnlyStrong
    @SurviveOnlyStrong 7 років тому

    9:30 Why we don't have debug features like this inside the engine? It would be great

    • @emmicd11
      @emmicd11 7 років тому

      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.

  • @nikolabozin9509
    @nikolabozin9509 6 років тому

    Is there extension for the materials tutorial? This was for beggines, is there advanced tutorial for example?

  • @AshikawaBetas
    @AshikawaBetas 9 років тому

    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

    • @PDANYreal
      @PDANYreal 8 років тому +1

      +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

  • @deva8496
    @deva8496 9 років тому +3

    Has anyone changed Texture dynamically?

    • @twentypast4
      @twentypast4 8 років тому +1

      +devtodev Yes, it can be done in C++

    • @deva8496
      @deva8496 8 років тому

      +Dan Toškan It can be done in bp. I have done

    • @mangop3773
      @mangop3773 7 років тому

      Could anybody do it?

    • @twentypast4
      @twentypast4 7 років тому +1

      Yes, I did it

    • @pieterdebie4162
      @pieterdebie4162 7 років тому +1

      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

  • @ConstructGames
    @ConstructGames 10 років тому +1

    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?

    • @Horsoniq
      @Horsoniq 10 років тому +5

      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

    • @ConstructGames
      @ConstructGames 10 років тому

      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.

    • @Horsoniq
      @Horsoniq 10 років тому +1

      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.

    • @ConstructGames
      @ConstructGames 10 років тому

      Etillion Ah good so it's still there.
      Thanks.

    • @HelderP1337
      @HelderP1337 10 років тому

      Etillion You're awesome.

  •  9 років тому

    How to make dissolving materials or transition from opaque to transparent?

    • @jolanpiep
      @jolanpiep 9 років тому +1

      ***** Create a random Alpha value I think

    • @jolanpiep
      @jolanpiep 9 років тому

      ***** Create a random Alpha value I think

    •  9 років тому

      jolanpiep now I am master in this :)))

    • @thebritishpotato2967
      @thebritishpotato2967 9 років тому

      +Jānis Grīnvalds where else did you use to learn after finsihing all unity's tutorials?

    • @emmicd11
      @emmicd11 7 років тому +3

      this is unreal engine not unity

  • @BaklaFiroz
    @BaklaFiroz 10 років тому

    I want your babies! Thanks for the awesome tutorials :)

    • @FabstaPizza
      @FabstaPizza 2 роки тому

      wat...

    • @CharlieRawlinson
      @CharlieRawlinson 2 роки тому

      @@FabstaPizza there were very few tutorials out there when I posted this. Offer still stands!

    • @FabstaPizza
      @FabstaPizza 2 роки тому

      @@CharlieRawlinson no... the first bit....

  • @pyrotechnick420
    @pyrotechnick420 6 років тому

    Looks like that random generator has a propensity to generate sea foam green colors lol

  • @irocklalot
    @irocklalot 5 років тому

    how do you make this with objects that are not static? like animations?

    • @Xegethra
      @Xegethra 2 роки тому

      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.

  • @TeamProSkill
    @TeamProSkill 10 років тому

    Why do the random numbers have to be 0-1?
    RGB goes 0-255

    • @Warbeast31
      @Warbeast31 10 років тому +1

      Base 100 so 255 would be 1 (100%) and by example 128 would be 0.5 (50%)

    • @TeamProSkill
      @TeamProSkill 10 років тому

      ok, thx :)

    • @Horsoniq
      @Horsoniq 10 років тому +2

      Yeh, they are just normalized.

    • @ShadowriverUB
      @ShadowriverUB 10 років тому +1

      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

    • @jolanpiep
      @jolanpiep 10 років тому

      Personally I would have preffered if they did it out of 100. Can you change that?

  • @ja7857
    @ja7857 7 років тому

    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?

    • @ja7857
      @ja7857 7 років тому

      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.

    • @emmicd11
      @emmicd11 7 років тому

      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.

  • @mangop3773
    @mangop3773 7 років тому

    Hi!! Is it possible to change the material (texture) instead of the color? It would be great!!