Dynamically Scale and Randomize Textures | Unreal Engine 5

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

КОМЕНТАРІ • 63

  • @plagiats
    @plagiats Рік тому +3

    Superb tutorial, no sponsor, no patreon plug, that's very refreshing. You have a voice similar to CodeMonkey (Unity UA-camr). Thanks for the info!

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

      Thanks for watching! I'm just here to help people out, the same way others here have helped me. :)

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

    I haven't started to build my world yet, but when I do I can tell this will be very usefull thanks!

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

      You're welcome, it definitely makes world building easier. :)

  • @rombergo
    @rombergo 7 місяців тому +2

    I don't know how many answers I've found saying to do this with blueprints and dynamic materials, but this was EXACTLY what i was looking for all along (but just couldn't get to work on my own because i didn't know to use the breakout node). Thank you!

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

      You're very welcome! Glad you found what you were looking for. :)

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

    And this just fixed my entire scene, thank you man. One of the things I'm wanting to do in my scene, for the floor tiles is to have a randomized pattern with different texture models if that is possible? Right now my fix is to have multiple tiles with the material I want, make the design and then merge them into a single object.

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

      If you want random textures on varied models then just assign the same tiling material on all the models and they'll all use a random tile.

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

    Great video Proc, i can't wait to try it!

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

    Amazing tutorial! Thanks for uploading it, it was really helpful! I only have one question though, the only texture variation we see is for the base color, wouldn't it be better to also connect the other textures (such as Roughness, Normal) to the node system?

    • @Procedural_Minds
      @Procedural_Minds  2 місяці тому +1

      Absolutely. It's exactly the same setup for all other textures so for the simplicity of the tutorial I only did it for base color.

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

      @@Procedural_Minds Thanks for your reply!

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

    Very nice, I’m doing something that needs this thanks so much. Also would be nice to change the color with a noise for like a mossy effect on some and maybe a dry look on others

    • @Procedural_Minds
      @Procedural_Minds  Рік тому +2

      You can absolutely use a similar setup to randomly tint or even select a new full texture based on random offset too. I might do a tutorial on that later on for that if you're interested. :)

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

      I think alot of people would be interested in mixintg textures like you are saying. Hope to see it!@@Procedural_Minds

    • @Procedural_Minds
      @Procedural_Minds  Рік тому +2

      @@MichaelEmbers I'll make a note of setting it up sometime in the near future. :)

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

      @@Procedural_Minds Definitely interested in seeing a tutorial like that which @MichaelEmbers suggested. :)

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

    Absolutely wonderful!! Thank you so much for this!!!!

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

    this is very useful and with rvt can produce more variations from 1 mesh very fast.With displacement back in 5.3 do you think we can use that too to change the surface for more variations without impacting the performance too much?

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

      In terms of shader instructions, it's barely any more since it's not recomputing after offsetting the textures. But if you try to do this at runtime then the cost will go up.

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

    AMAZING!! thank you ! sir

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

    Awesome! This fixed a lot of my problems. Just curious how much does this impact the perfomance?

    • @Procedural_Minds
      @Procedural_Minds  Рік тому +2

      It's not performance heavy since all you're doing is just offsetting UVs, and it only calculates that when you're moving / using it. You can add a Static Switch Parameter to it and just disable it for pieces you don't want it on if you want it in a more general setup.

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

    Is it working with the tilable texture? means texture maps from Substance Painter, I have tried but did not get the perfect result.

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

      Yes, I use it primarily with tiling textures. If you don't scale uniformly then you still get uneven tiling since it takes the average.

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

    4:42 you didnt say what node you added in???

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

      That is just a constant 3 node, like you would use for colors. You can get it by holding down 3 and clicking as a hotkey.

  • @_Frost_42
    @_Frost_42 6 місяців тому

    Where is the object position node? I can only find "Object position (Absolute)". I followed your setup, but its not working for me. Im guessing its because of this?

    • @Procedural_Minds
      @Procedural_Minds  6 місяців тому

      I'm pretty sure that's the same node. It just doesn't say absolute when in the editor.

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

    why use average of x y and z... instead of scalexyz? What does scale XYZ actually do?

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

      Scale XYZ is a float 3, instead of a Float 1. It's like an RGB vs just an R. I don't want 3 channels in this case, but rather the average of the 3.

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

    Cool tutorial, thank you! How do you randomize the UVs based on mesh element?

    • @Procedural_Minds
      @Procedural_Minds  2 місяці тому +1

      You need to get some kind of information from your asset and then you can modify the UVs based on that however you want in the material editor.

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

      @@Procedural_Minds well yes, I assume I need to get mesh element IDs, but how is a mystery to me.

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

      @@Andy_Shust Do you mean you want to do it based on separate meshes? Then you'd need a blueprint to get this information and then pass it along to your main mesh's material using either custom primitive data or dynamic material instances.

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

      @@Procedural_Minds I feel that my vocabulary (I come from 3Ds Max / Blender) doesn't fully correspond to that of UE people, so it probably leads to misunderstandings =D Let's say I have a static mesh which consists of 100 cubes that are not connected in any way (they are called 'elements' in 3Ds Max). I want the texture to get a random UV offset/rotation on each mesh element. If getting this kind of information is possible via a blueprint, I will take a look into it, thank you!

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

      @@Andy_Shust What you're describing is just 100 separate objects in a level. You can just do it based on position then and use the same setup as in the video to randomize the UVs.

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

    what did you press to get "multiply by three random values" 4:40

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

      nvm i just searched for constant three values

    • @Procedural_Minds
      @Procedural_Minds  9 місяців тому +1

      I just typed in the random values. You can get a 1,2,3 or 4 value node by just pressing 1-4. I need a foat 3, so I pressed 3.

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

    Why is this more efficient thatn triplanar? Performance reasons?

    • @Procedural_Minds
      @Procedural_Minds  11 місяців тому +1

      Yes. Triplanar uses 3 texture nodes, while this uses one. So in terms of shader complexity it's considerably more efficient.

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

      Thank you for your response @@Procedural_Minds

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

      @@STANDBYEXP Any time :)

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

    Hi, great tutorial. I just want to ask one thing, it works perfectly when we scale the static mesh uniformly, but what if we want to fix the tiling size when we scale it non uniformly (let's say we want to set scale the static mesh x=0.5 y=2 to z=4)? Is there a way to do that?

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

      The way it's currently setup, it takes the average of the 3, so it'll take the average of 0.5, 2, and 4, which is about 2.16 and tile the texture 2.16 times. There's no real way to associate UV space with 3D space that's exact for each object, so this is my best solution. You can definitely just plug in X for U, and Y for V for example, and ignore the Z axis. But that'll be entirely dependent on how you would like it to be setup.

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

    wow...
    nice job.
    Thx for this ;)

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

    Love your videos dude. I hope to join in on another stream one day.
    But I can tell you that your calculations are wrong :'D (sorry lol). The texture size is NOT all the same size for all the meshes. it's 1/3rd the size of the mesh.
    you took the scale, added all together and divided by 3. eg. 2+3+5 = 10. divide that by 3 you get 3.3.
    What you want to really do is take texture and multiple by the inverse of the scale of your object (1/scale).
    So if your object scale is 1, the inverse of 1 is 1 so no change. If the scale is 2, then the inverse is 1/2. your object scale is now 2 and texture is now 1/2 so they line up perfectly.
    if you scale your object to 10, the inverse if of 10 is 1/10th.... well you get what I'm saying haha.
    That's how you would truly get your textures to all be the same size. Hope this helped.

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

      Yeah, this setup assumes uniform scaling and if it's not uniform then it just does a close approximation. Good enough for me and probably many others. It's not a perfect setup.

  • @HumpaLumpaBiriBam
    @HumpaLumpaBiriBam 6 місяців тому

    small mistake!, UV is v2 = simply Object Scale -> make v2 from XY or mask RB * UVTex * your v1 multiplier then apply to your main texture & normals. DONT add Z!! this gives you wrong result! try it. You want to maintain uniform uv original mappings. dont add 3rd Z value it will messed up your uvs!!!

    • @Procedural_Minds
      @Procedural_Minds  6 місяців тому

      The reason I add all 3 to get the average is so it scales the tiling no matter which axis you scale the object on. If I only take 2 then if you scale on the third axis then it'll just stretch it.

  • @benblaumentalism6245
    @benblaumentalism6245 День тому

    Oddly, it’s not working here. Try it with a brick wall shader. Scaling any mesh the instance is applied to definitely stretches and squishes here. Is the point of this to preserve the tiling scale regardless of the mesh scale like a triplanar? If so, it definitely isn’t working here. I promise I’m doing exactly what you’re doing.

    • @Procedural_Minds
      @Procedural_Minds  День тому

      No, it's not meant to work like triplanar. This is a cheap way of tile your texture when you scale your object uniformly. If you're doing non-uniform scaling then you'll get a bit of stretching.