Тёмный

Dynamically Scale and Randomize Textures | Unreal Engine 5 

Procedural Minds
Подписаться 7 тыс.
Просмотров 9 тыс.
50% 1

This is a UE5 tutorial showing how to modify the UVs in your material to automatically scale the textures based on object size, as well as randomly offset them to break up repetition between copies / instances of the same object.
---------------------------------------------------------------------------------------------------
Patreon: / procedural_minds
Discord: / discord
Twitch: / krozjin
---------------------------------------------------------------------------------------------------

Опубликовано:

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 61   
@plagiats
@plagiats Год назад
Superb tutorial, no sponsor, no patreon plug, that's very refreshing. You have a voice similar to CodeMonkey (Unity RU-vidr). Thanks for the info!
@Procedural_Minds
@Procedural_Minds Год назад
Thanks for watching! I'm just here to help people out, the same way others here have helped me. :)
@rombergo
@rombergo 6 месяцев назад
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 6 месяцев назад
You're very welcome! Glad you found what you were looking for. :)
@lordmaddog6003
@lordmaddog6003 Год назад
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 Год назад
You're welcome, it definitely makes world building easier. :)
@gaguto
@gaguto 3 месяца назад
Great video Proc, i can't wait to try it!
@Procedural_Minds
@Procedural_Minds 3 месяца назад
Thank you. Let me know how it goes. :)
@ThatDamnedGamer1
@ThatDamnedGamer1 8 месяцев назад
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 8 месяцев назад
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.
@scottdpeterstv
@scottdpeterstv 6 месяцев назад
Absolutely wonderful!! Thank you so much for this!!!!
@Procedural_Minds
@Procedural_Minds 6 месяцев назад
You're welcome! :)
@ajiramadhan13
@ajiramadhan13 10 месяцев назад
AMAZING!! thank you ! sir
@Procedural_Minds
@Procedural_Minds 10 месяцев назад
You are very welcome! :)
@karlblumstein8396
@karlblumstein8396 11 месяцев назад
wow... nice job. Thx for this ;)
@Procedural_Minds
@Procedural_Minds 11 месяцев назад
You're very welcome :)
@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 Год назад
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 Год назад
@@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. :)
@BuGiorgio
@BuGiorgio Месяц назад
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 Месяц назад
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 Месяц назад
@@Procedural_Minds Thanks for your reply!
@RiverFox_YT
@RiverFox_YT 2 месяца назад
4:42 you didnt say what node you added in???
@Procedural_Minds
@Procedural_Minds 2 месяца назад
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.
@Flare3103
@Flare3103 Год назад
Awesome! This fixed a lot of my problems. Just curious how much does this impact the perfomance?
@Procedural_Minds
@Procedural_Minds Год назад
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.
@HumpaLumpaBiriBam
@HumpaLumpaBiriBam 5 месяцев назад
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 5 месяцев назад
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.
@_Frost_42
@_Frost_42 5 месяцев назад
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 5 месяцев назад
I'm pretty sure that's the same node. It just doesn't say absolute when in the editor.
@rohaanallport677
@rohaanallport677 10 месяцев назад
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 10 месяцев назад
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.
@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.
@STANDBYEXP
@STANDBYEXP 10 месяцев назад
Why is this more efficient thatn triplanar? Performance reasons?
@Procedural_Minds
@Procedural_Minds 10 месяцев назад
Yes. Triplanar uses 3 texture nodes, while this uses one. So in terms of shader complexity it's considerably more efficient.
@STANDBYEXP
@STANDBYEXP 10 месяцев назад
Thank you for your response @@Procedural_Minds
@Procedural_Minds
@Procedural_Minds 10 месяцев назад
@@STANDBYEXP Any time :)
@Andy_Shust
@Andy_Shust Месяц назад
Cool tutorial, thank you! How do you randomize the UVs based on mesh element?
@Procedural_Minds
@Procedural_Minds Месяц назад
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 Месяц назад
@@Procedural_Minds well yes, I assume I need to get mesh element IDs, but how is a mystery to me.
@Procedural_Minds
@Procedural_Minds Месяц назад
@@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 Месяц назад
@@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 Месяц назад
@@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.
@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.
@lelman
@lelman 8 месяцев назад
what did you press to get "multiply by three random values" 4:40
@lelman
@lelman 8 месяцев назад
nvm i just searched for constant three values
@Procedural_Minds
@Procedural_Minds 8 месяцев назад
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.
@mindped
@mindped Год назад
why use average of x y and z... instead of scalexyz? What does scale XYZ actually do?
@Procedural_Minds
@Procedural_Minds Год назад
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.
@nikashsn24
@nikashsn24 8 месяцев назад
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 8 месяцев назад
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.
Далее
Physically Based Cel Shading
36:41
Просмотров 113 тыс.
HA-HA-HA-HA 👫 #countryhumans
00:15
Просмотров 3,1 млн
Why Do Video Game Studios Avoid Blender?
6:49
Просмотров 606 тыс.
Nanite Forest Optimisation in Unreal Engine 5
21:06
Просмотров 8 тыс.