How to map texture to landscapes 0-1 UV coordinates, no tiling

Hi,
I’m trying to put a texture onto a landscape that has no tiling - same way you’d put a texture on a character model for instance. It should fill the 0-1 space.

I am trying to use landscape layer coordinates but having a hard time. How do I determine the correct scale? My terrain is 4033, but when I input 4033 it looks a little off. And the big problem is that the texture is not aligned, and the Mapping Panning values seem random. I have put many values in there but cannot figure out what it is actually doing because the results seem random.

For instance, I got one axis to align with a Mapping Panning U value of 0.41. Why? The problem is, that took an hour because I have to enter values on at a time, recompile the shader, and that can take up to a minute.

I must be doing something wrong, this cannot be the normal way to map a texture to a landscapes 0-1 space.

Any advice is apprecaited.

1 Like

You do this with world position offset and bound size.
That way no matter what the landscape size is, the UV will always be in a 0 to 1 range for the whole landscape.

1 Like

awesome thanks!

Hi, I have the same problem. But I can’t understand what you wrote as a solution. Can you explain more clearly?

3 Likes

Is there any update on this? I can’t seem to align normal map of landscape exported from Gaea to landscape itself

you can do it like this:


to get the landscape size select the landscape actor and check teh details panel here:


Overall resolution
just enter that number as the divisor to landscape coords

1 Like

That’s a really bad suggestion.
Landscape layer coord can be given different values. With different values your division node would become more and more useless.

Using UV0 you’d never have the issue.
There’s some precise math for it I can see about digging out in a second…

landscapes typically dont change so it works fine for me.

why bother saying it is bad if you wont show a better suggestion?

That’s an Assumption. With a real emphasis on the first 3 letters part…
Landscapes change from level to level. What works in one level probably won’t work in another.

Object Position > Mask RG > Subtract A
Object Bounds > Mask RG > Subtract B
→ Result into > a new Subtract B

Absolute WP > Mask RG > the new Subtract A
→ Result into > Divide A

From: Object Bounds > Mask RG > Multiply * 2 > Into Divide B.

End result is a UV that will always cover any landscape of any size. Or any object for that matter - in X/Y directions.

it’s not an assumption in my project, it is how I’ve designed it. all landscapes are the same size, and if they werent it still doesnt matter because each has a unique material instance so i can just make the divisor a parameter. Ezpz.

Thanks for the additional solution, but you do have the communication skills of a cat.
If you dont like the inflexibility of my freely given solution, all you have to do is add yours and say, “this solution has the benefit of requiring no further input and works regardless of landscape size.” And then I’d say, “awesome, thanks dude.”

I may have missed somthing as trying you solution doesn’t give me the expected result.



It ends up with UV(0,1) for each Landscape componant, not the full landscape

it work on a simple object though

It’s possible they changed the Object Bounds for the landscape to match Components, instead of the the full landscape - with Nanite and all the other stuff (that doesn’t work anyway) they added in there.

However you aren’t applying the mask before the operations. As far as I see, it should not matter. Provided you use float 3s as you did.

The other option is to change the setting on Object Position - or maybe they even added settings to Object Bounds you can alter.

The pseudo code works fine in Ue4 .18 to .27 since I haven’t had display issues with it ever since I initially set it up.
I do generally mask First - since it’s less math to be processed if you do. Again, that should not be the issue for you…

I suggest you try output a float debug of the bounds to see what value it gives you and why (match it to the landscape, or the component etc)