I’m working a huge terrain at the moment (200kmx200km) with an 8k base texture covering the whole landscape. the land is covered in a road network, and I’m working on setting up a texture that gives the appearance of farmland and crops between all the roads, seen from the air - this kind of thing:
instead of adding the base crop regions into the 8k texture, my idea is to rotate the UV coordinates of all the fields, so that I end up with all these little islands with different UV orientations, that I can then apply a tiling texture to. The reason for doing this would be so I can get a lot more apparent detail out of lower resolution textures, because they wouldnt be getting stretched over the entire landscape.
Using Houdini I’ve managed to make an 8K UV replacement image like this:
my material network looks like this, and you can see the result applied to the terrain (I’m displaying the UV image directly here, but the idea is that the UV image goes into the UV input of the texture you want to tile)
Now, the main issue I’m having is that the UV image loses information through texture compression, the size of the terrain, texture filtering etc, and it ends up distorting the tiling texture too much.
I’m wondering if anyone has suggestions on how to reduce the amount of info lost in the UVs, or is there some other way I could “rotate” the UV space of each field/island. For example, could I colour each island with a different “rotate” value (remap 0-180 degrees to 0-1 colour value) and then plug that in somehow into the UV coordinates.
I hope that all makes sense, any ideas on how to improve this would be excellent. Cheers!
I think a hierarchical static mesh instance creator would work best if you’re using the same material over and over. When they get spawned have a random rotation variable. No messing with UVs
So far the following thoughts:
- Use sharper mips / sample from higher mip levels
- Use some sort of texture bombing, either on the final texture, or UV texture.
- Generating this kind of UVs procedurally.
, texture bombing was something that crossed my mind as a possible method, I’ll certainly look into it.
Mike, not quite sure what you mean about using static meshes, as each “field” in my terrain is a completely unique shape and size - they are also not random, the road network that originally defined where my fields are is based on a real world place.
Actually I’ve thought of another possible approach. For each island I need to store the rotation pivot and the angle of rotation. I can get that info in Houdini and save it into RGB
red = pivot x
green = pivot y
blue = rot angle
then i can render that as an 8k image but it will be made up of consistent solid colours. I can then pump that into a custom rotator node, something like this :
I just had it pointed out to me by a friend that it’s even easier, if using a repeating/tiling texture I don’t even need the pivot points for the rotation. I’ll post some updated results tonight.
So a little more progress - I’ve stored the rotation of each field in the blue channel, and feed that into a customRotator node which gives a much better result. Still some distortion where fields touch, but I can live with that. Next step is to use the Red/Green channels to store a positional offset value, so that each field can select a field “pattern” from an 8x8 texture atlas. Eventually with some layer blending and further tiling detail textures, this will all get mixed with my base colour layer
Keep in mind that colors are stored in sRGB space but things like uv’s or rotations should be stored in linear space. BC5 compression that is used for normal maps seems to be perfect fit for UV’s. BC4 would be perfect candinate for rotation.
is right that you are basically wanting to do texture bombing. But to do proper texture bombing on landscape is quite expensive. It means for each ‘cell’ you need to also look up the neighbor cells and blend them at the edge, or else there will be hard edges.
Baking out the UVs like you are doing won’t work, because you cant store a ‘blended UV’ like that, it would have to be hard edged.
Have you tried using the material node “Vector noise” set to 'cell noise?"
If you want proper texture bombing, you can do it by using just the ‘voronoi noise’ part to look up the offset neighbors, before doing the Cellnoise, and you’d need to do it 8 times.
I did make an existing texture bombing node in ue4, but for performance reasons, it does not rotate each chunk, it just offsets and flips them 90 degrees sometimes. Try that out though, might be good enough as long as your texture doesnt start with a grid.
Thanks for the replies guys, one thing that I didn’t make clear in my original post is the rotations of my cells are non random, so in that sense it differs from texture bombing. In houdini I’m doing a process of finding the dominant direction of each cell by tallying up edge tangent directions. I want my fields to run parellel or perpendicular to the roads that split the cells. The rotator node is doing exactly what I want really but I need to play with compression formats and check border values in my source image.
To fix the edges, you could store an edge mask and just blend to a regular tiling texture there.