Adding 'Absolute-World-Position' node to my existing material blueprint.

So I want to place 2 walls next to each other, however this god awful ugly line forms in the middle. I’ve seen multiple tutorials where they fix this by using a ‘Absolute-World-Position’ and eventually plugging it in by the ‘Color Sample Texture’. However, I’ve already edited my material’s rotation + scale, so I simply don’t know where to add the nodes of the tutorial to my existing blueprint. I’ll post some screenshots below:

  1. Wall-Bug

  1. My existing material blueprint:

  1. Tutorial blueprint:

Any help with this will be immensely appreciated

Thank you for your time
Kind regards

This is the easy way :slight_smile:

1 Like

Thank you very much! I’ve done that and it’s solved the ugly line problem which is super awesome.

I’m sorry to be a bother, but how would I go about adding a randomizing effect, so the texture doesn’t show up in a repeating pattern?

Thank you for your help and patience I really, truly appreciate it as I’ve been feeling a bit depressed with how much I am struggling with this.

Kind regards

Always the question, eh? Multiple solutions, look at texture-bomb node for a start, but it usually comes down to:
a - multiple texture samples blended in some creative way, by height, scaling them up progressively (small/med/large), or some other noisy-pattern
b - funky-maths on the addressing/UVs so that you sample in a random-pattern. for that, go here: Randomized tiling function, eliminate repeating patterns in your textures!

‘a’ is like a catapult, brute-force, but it works well-enough
‘b’ is like a trebuchet, ultimately better in all/most ways except for the know-how required to build it

note that these are just 2 ways, but it ultimately comes down to something that samples 3+ times if you REALLY don’t want to see tiling in an appreciable area.

njoy

just as a practical example of ‘b’, it doesn’t really tile, but in the non-tiling pattern you can see an overall influence:

landscape


The only reason you even see those whitish lines/areas is that it’s part of the texture so even with a ‘bad’ setup it still mixes well.

Other things related to UVs:

1 Like

So this is how far I’ve gotten to randomize the textures, based on this tutorial (https://www.youtube.com/watch?v=WlwfA4wd338)

However, I’m getting this error: [SM6] Function WorldAlignedTexture: Cannot cast from smaller type float2 to larger type float3.

Is what I’m doing even the correct way? In the tutorial he’s connects the ‘Add’ node to a ‘Texture Sample’ nodes’ UV input. But I’m working with Texture objects. Thoroughly confused.

Unfortunately, there isn’t much documentation i.t.o randomizing Texture objects. Every tutorial I’ve come across, they work with texture samples.

Thank you in advance!

TexCoord(x) is a 2vec, you multiply it by a 1vec and then add to a 2vec you built, it’s still a 2vec when you stick it into the WorldAlignedTexture and the function is expecting you to feed it a 3vec.

Ideally you would append another scalar to make it a 3vec but what is the key… World-aligned will give you a triplanar projection, something is projected along each axis, weight-blended so a texture seems to seemlessly wrap around an object. It does this in worldspace, along the world’s XYZ axis). TexCoord(x) wraps/addresses along the local-space of the object, when someone creates it in Blender and sets up UVs. The addressing is part of the object and can be read in the shader. With Worldspace, you are just-tiling in a different coordinate-system, absolute, outside the object. If you move your wall the texture might appear to swim, since the world-coordinates won’t ever move themselves, only the object…

So! In this case, World-Aligned could be the way to go to wrap stuff seamlessly but wouldn’t give you mix-it-up/untiling.

You didn’t do it wrong, you just happened upon two incompatible methods.

FWIW, the tutorial looks good, particularly cheap for a per-object mix-it-up. With that it wouldn’t need the world-aligned node, so take those out for at least this use-case.

As for texture-object vs texture-sample vs texture-sample-parameter… A texture-object is a thing that points to a texture; done. It can then be plugged into a texture-sampler as one of the configuration options, like UVs. If you crack open the world-aligned node you should see samplers therein. They read in whatever texture you pass in via the texture-object node. YOU don’t actually sample the texture when calling the node, the code therein does. You just need to tell the engine what texture in particular you want.

A pedantic distinction to be sure but such is code…

Anything with ‘parameter’ in it’s name is exposed in a material instance when you apply it to an object. This makes it editable in the instance, setable by code so you can do stuffs at runtime. A texture sample parameter is the texture object and sampler in one. Why the multiple ways to do the same thing? Sometimes you just need to expose one thing and sample it multiple times, like in world-aligned, sometimes you need to set each sample(r), all depending on your shader logic.

Hope this helps.

1 Like

Thanks man I think I understand a little bit more now. I’ll keep at it for sure. I’ve only started working with Unreal about 3 days ago, so I’m still completely lost in the woods. But it helps when cool peeps like you points me in the right direction.

I appreciate your thorough explanation and your taking the time to help me. I thoroughly appreciate your help.

Thank you and kind regards

Watch and learn:

For both of you, since this will probably break up any tiling issues on anything or just about…

And to be clear, there is nothing preventing you to do exacftly what he shows just because one texture you have is WPO based.
The key is to use the other texture as the Lerp Alpha value for whatever else you use to break the tiling up.

At the same time, you would be better off mapping your object(s) to a proper set of UVs and setting up dadicated materials that are made to properly tile…

1 Like

Thanks for the reply man, however I can’t really follow this guy as he doesn’t show his full blueprint (the whole left side of the tutorial is blotted out by this screen…), so I’m at a loss as to how to imitate him.

While I appreciate the help, it’s just super frustrating that I’m getting these long-winded explanations that’s not really helping a n00b like me, as I simply don’t understand the lingo yet. I’m seriously at a complete loss at the moment.

I’ve followed this tutorial to randomize the textures, but it literally does nothing. There is zero randomizing effect: https://www.youtube.com/watch?v=WlwfA4wd338. And now I still have the tiling issue.

I’ve now followed another tutorial for tiling (https://www.youtube.com/watch?v=fRsjgWgaMXY&t=718s) and I’ve achieved semi-decent results, although it doesn’t negate the line between mesh’s completely, it’s almost undetectable.

Here is the blueprint:

So can anyone, without typing 3 long paragraphs or using words this laymen cannot understand, please explain which nodes I need to insert here to randomize the textures? I’m seriously willing to pay someone to figure this out.

Is there any actual documentation about how to randomize + scale textures at the same time?

It can’t be this difficult can it? I can’t believe I’ve been struggling with this for 2 days lol. I feel like a complete moron.

Thanks in advance.

1 Like

So yes, it can be difficult. This type of thing has long-been a thorn in the side of graphics-programmers: untiling, making things seem organic, natural w/o the visual influence of maths/patterns.

Think about this:

  • you have a grass texture, it’s not bricks, not floor-tiles, it’s decently random on it’s own, but we all know if you put it on a thing, it’s gonna tile. either color-splotches will stand out, or lines at the seams

  • so! you say, hey! what if I took 3 random circles/samples from this square texture, and then blended them on top of one another, rotating them randomly, and I keep doing that all over? instead of squares against squares, generating tiling-artifacts, it’s a mish-mash of randomly subsampled sections of the texture, mixed. that’s the ‘b’ I gave you above.

  • this works GREAT with organic textures. from personal experience I can say rocks, grass, sand, dirt, concrete, etc; it’s great and easy on the samples

  • now, take that same method and apply it to something very regular, like bricks. if I take random-samples, randomly rotate & offset, then mix them up, the grout and tiling of the brick-pattern will come out all wonked up: the same type of method just wouldn’t work with a well-ordered texture

  • past that! you come back and say, OK! how about I use the method tharle showed with the gridded-square being mixed and sampled. yes! that would (ideally) work, but then I would have to go back to you and ask how many bricks wide and tall is your texture, where are the seams, etc because we need to know if the texture is 4 bricks wide, 5, 6?

  • any UV trickery is going to be somewhat case-specific. In brick/tile kind of case you are well-served with getting your texture itself set up to help make tiling easier. If you notice in the tharle video, he has a nice 4x4 floor-tile set in his texture so chopping that up into subsections is very easy, no overlap. in your brick texture that’s not true, so you would have to either take that into account for your maths, or rework the texture to make it more suitable. Sometimes the solution doesn’t lie in the shader, directly, sometimes it’s the texture you are feed into it.

Thus no, not really, I myself cannot get you maths that would make that particular wall never-tile. There’s no real ‘correct’ answer, shaders are math but mostly art at the end of it. And yes, wall of text, but it’s only to illustrate the depth of what you are actually asking…

1 Like

You probably need to stick with world aligned OR just texture nodes. It is possible to mix them up, but you need to know what you’re doing.

So, sticking with WA, you can input noise like this

Plain brick

with noise amount = 1

For clarity, I’ve not included normal, roughness, UV scale and all the other stuff. But the principle is the same.

Here’s with a few more parameters.

You can keep going as far as you want. Height lerp to make the dirt sit in the cracks etc. Lerping between roughness and so on.

2 Likes

I just made a material designed to break patterning : Pattern breaking tiling | Fab, I think that’s what you were looking for ?