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

UE4 BP 1 - How To Set Material Parameters On Instanced Mesh Components - Unreal Engine Tutorial

Поділитися
Вставка
  • Опубліковано 19 сер 2024

КОМЕНТАРІ • 39

  • @Sluggernaut
    @Sluggernaut 5 місяців тому +1

    OMG I have been trying for 3 days to figure out why changing parameters on individual instances wasnt working. I had to use the PerInstanceCustomData stuff in the material! Thank you!

  • @robinj6997
    @robinj6997 7 місяців тому

    oh... my... god! The amount of insanity I can do with this! Thank you!

  • @vitaliikhomenia202
    @vitaliikhomenia202 2 роки тому +2

    Thanks. Was looking for way to set up different texture per instance :)

  • @MichaelRoyalty
    @MichaelRoyalty 11 місяців тому

    Thank you so much for this tutorial. I'm using this method to dynamically modify meshes spawned with the PCG tool, it works great!

  • @DeeOdzta
    @DeeOdzta 2 роки тому +2

    This superb! Thanks a lot for sharing this method. new sub.

  • @Mantikator
    @Mantikator 3 місяці тому

    Thank you so much!

  • @jbbird3548
    @jbbird3548 Рік тому

    ooo this'll blend well with the other series, thanks!!

  • @mordormetin
    @mordormetin Рік тому

    Clean..

  • @DigitalGreenTea
    @DigitalGreenTea 4 місяці тому

    Sometimes the Set Custom Data Value fails. Then that specific instance is just black. I checked this with the return boolean. I wonder why it fails at times?

    • @AlexQuevillonEn
      @AlexQuevillonEn  4 місяці тому

      That's actually something I never looked into, but yeah, it's a bit unstable. Even in newer versions of Unreal

  • @Max_Stupa
    @Max_Stupa 8 місяців тому

    Thanks for the explanation.
    I have only one question. You mark the render state dirty after setting parameters for each instance. From the performance side, if we have a lot of instances for one ISM, it may be much more efficient to mark render dirty once. Or do you think we should do it strictly for each instance?

    • @AlexQuevillonEn
      @AlexQuevillonEn  8 місяців тому

      I think you can just do it once at the end. I just used the lazy route :P

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

    That's pretty awesome. But do you think there's a way to do it with actual textures, so that a single object can have more than one color (or just... a texture)?

    • @AlexQuevillonEn
      @AlexQuevillonEn  Рік тому

      You can always have multiple textures in your material and switch between them with a LinearInterpolate.
      Which you can control with the CustomData :)

    • @dieblauebedrohung
      @dieblauebedrohung Рік тому

      @@AlexQuevillonEn you can only set them up once then though, and switch between existing ones that way (if it's inside the Material). You can't actively set a variable amount of them in your blueprint that way I guess?

    • @AlexQuevillonEn
      @AlexQuevillonEn  Рік тому

      @@dieblauebedrohung Exact, but you can change the textures with blueprints.
      But keep in mind that changing material parameters (not CustomData) will affect all the Instances.

    • @dieblauebedrohung
      @dieblauebedrohung Рік тому

      @@AlexQuevillonEn yeah excactly. That's the problem I face rn. Trying to assign a variable amount of textures randomly to thousands of [different] objects without getting additional draw calls for each texture re-use.
      Thank you for your quick response thougj! :)

    • @TheAxebeard
      @TheAxebeard Рік тому

      @@dieblauebedrohung Did you ever figure this out? I'm using a Texture Atlas and *attempting* to use the Custom Data to change the U and V coordinates of the texture, which should work in theory, but I can't actually get Custom Data to update in real-time in UE5 for some reason.

  • @dmnyktv2739
    @dmnyktv2739 9 місяців тому

    Is there a way to break a texture down to float value to do this ?

    • @dmnyktv2739
      @dmnyktv2739 9 місяців тому

      Tryna get custom data to work with the RGBA of. A texture so it can choose a texture based on height

    • @AlexQuevillonEn
      @AlexQuevillonEn  9 місяців тому

      @@dmnyktv2739 I don't think it's possible (at least, not easily).
      The only suggestion I have would be to add all the textures you need directly in the material and then switch between them based on a Scalar Parameter. (With something like a Lerp or an If)

    • @dmnyktv2739
      @dmnyktv2739 9 місяців тому

      @@AlexQuevillonEn surprisingly I got it to work using a switch node with the textures plugged into it then a custom data value running into the switch value with the custom data value being changed per height level took me hours to figure out but it's actually quite simple
      One major downside tho the textures don't blend together they tile weirdly due to it being applied to sperate meshes I gotta figure out a way to have it set to nanite and still use custom data maybe primitives?

    • @dmnyktv2739
      @dmnyktv2739 9 місяців тому

      @@AlexQuevillonEn just figured out a fix for it while using custom data values you csnt have nanite and instances static mesh both on so instead use a scalar paramater called texture connect that into the switchvalue with the textures connected to the switch create a dynamic material instance in your construction script of your actor your trying to change the texture of dynamically then add a sequence with the height conditions setting a float value using the values of the switch textures you want per height then connect each of the branches exec pins into a set scalar paramater node connected to the create dyanmic material node with a set material node right after setting your mesh to that dyanmic material or texture based on height conditions no need for custom data values and no tiling issues 🙏

  • @danielso644
    @danielso644 Рік тому

    Hello Alex, do you think it’s possible to edit vertexes of specific instances meshes with geometry script or otherwise?

    • @AlexQuevillonEn
      @AlexQuevillonEn  Рік тому

      You mean moving the vertices around? I don't think it's possible.
      But, you probably can add a WorldPositionOffset (with a mask) in the material to offset the vertices you want.

    • @danielso644
      @danielso644 Рік тому

      Ah okay well that’s unfortunate, will have to look into world position thanks for the response.

  • @user-ro1su4ii4w
    @user-ro1su4ii4w 10 місяців тому

    not find out the "num cuntom data floats" in ue5.3😭

  • @joeymalta749
    @joeymalta749 Рік тому

    Is it possible to do this with a texture aswell ?

    • @AlexQuevillonEn
      @AlexQuevillonEn  Рік тому

      I don't think so :/
      But you could always either
      - have both textures in your material and switch between them using the float parameters.
      - or have an atlas of textures and choose which one you want.

    • @dmnyktv2739
      @dmnyktv2739 9 місяців тому

      Maybe if we could somehow store different rgb values of materials with just a base texture like grabbing the texture rgb values then inputing them into the custom data value with a condition set up for choosing while using a texture sample instead of color coords for the rgb input in the material blueprint

    • @dmnyktv2739
      @dmnyktv2739 9 місяців тому

      I can't figure out how to grab rgb values from a texture or material variable in blueprint tho I've seen it done before but don't know how that's the only thing stopping me