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!
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.
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?
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
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. :)
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?
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.
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.
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?
@@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.
@@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!
@@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.
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?
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.
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.
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.
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!!!
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.
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.
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.
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!
Thanks for watching! I'm just here to help people out, the same way others here have helped me. :)
I haven't started to build my world yet, but when I do I can tell this will be very usefull thanks!
You're welcome, it definitely makes world building easier. :)
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!
You're very welcome! Glad you found what you were looking for. :)
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.
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.
Great video Proc, i can't wait to try it!
Thank you. Let me know how it goes. :)
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?
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.
@@Procedural_Minds Thanks for your reply!
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
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. :)
I think alot of people would be interested in mixintg textures like you are saying. Hope to see it!@@Procedural_Minds
@@MichaelEmbers I'll make a note of setting it up sometime in the near future. :)
@@Procedural_Minds Definitely interested in seeing a tutorial like that which @MichaelEmbers suggested. :)
Absolutely wonderful!! Thank you so much for this!!!!
You're welcome! :)
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?
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.
AMAZING!! thank you ! sir
You are very welcome! :)
Awesome! This fixed a lot of my problems. Just curious how much does this impact the perfomance?
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.
Is it working with the tilable texture? means texture maps from Substance Painter, I have tried but did not get the perfect result.
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.
4:42 you didnt say what node you added in???
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.
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?
I'm pretty sure that's the same node. It just doesn't say absolute when in the editor.
why use average of x y and z... instead of scalexyz? What does scale XYZ actually do?
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.
Cool tutorial, thank you! How do you randomize the UVs based on mesh element?
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.
@@Procedural_Minds well yes, I assume I need to get mesh element IDs, but how is a mystery to me.
@@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.
@@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!
@@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.
what did you press to get "multiply by three random values" 4:40
nvm i just searched for constant three values
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.
Why is this more efficient thatn triplanar? Performance reasons?
Yes. Triplanar uses 3 texture nodes, while this uses one. So in terms of shader complexity it's considerably more efficient.
Thank you for your response @@Procedural_Minds
@@STANDBYEXP Any time :)
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?
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.
wow...
nice job.
Thx for this ;)
You're very welcome :)
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.
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.
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!!!
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.
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.
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.