UV unwrapping and scaling the islands out of the texture bounds

Hi,

I want to have my models to be exported into a game engine so this is not a question only related to doing nice renders inside Blender.

So I have encountered several tutorials (while not stating being specifically for game engine usage) where the teacher scales some of the UV islands larger than what the texture bounds are (mainly diffuse). This makes it possible to have a “proper” scale, specially with seamless textures, if the islands / model is large and/or the texture a smaller one.

While this looks good when doing a render this do not seem to work at all if the models are exported into Unity / Unreal for instance.

I am still a beginner modeler but I thought unwrapping should always take place inside the texture boundaries. Is this what I should be doing if I want to do it “correctly”? If scaling like this should be avoided, what’s the correct procedure for creating proper scaled textures? To have higher resolution texture? Do some photoshopping so that the islands inside the diffuse texture boundaries are of a correct scale?

Any other insights on this topic?

Cheers, Jax

Bump. Does anyone know anything that could help me understand this?

It’s generally sort of a standard that textures should be repeating if the UV coordinates are outside 0-1 range, it’s most common, but it does depend on the shader and it can be different. They can tile in only one axis and the border pixel values can be extended in the other for example. UVs can be set up any way you want. Their coordinates are meaningless on their own. Any meaning is assigned to them by the shader used. You create UVs for a shader and you need to know exactly how it is going to treat them.

Thanks MartinZ for a reply!

So, I think I know what UV mapping as a process is about but I have seen ppl teaching that you can scale your islands bigger than what your texture bounds are. So an example. I have a quad. Now lets say I unwrap it to a texture so coordinates become (0,0), (0, 1), (1, 0), (1, 1). Now you have this one island that you scale larger what the texture bounds are.

What effectively happens (inside Blender) is that the texture gets repeated more depending how much you scale. And you can do a nice render inside the Blender. But this mechanic do not work if you export the model to Unity / Unreal Engine.

When you scale the UV islands larger, do they get UV coordinates outside 0,1 boundaries? And so are you also saying that shaders inside Blender know how to handle these coordinates out of the box and for example Unity Standard shader do not (since exporting a model unwrapped like this do not look correct)?

If so what is the preferred or correct way of unwrapping? As I have understood it would be better to use the texture boundaries when creating models to the game engines but have I understood this correctly or no?

Thanks again!

Cheers, Jax

UVs have coordinates that have no meaning until you assign a meaning to them. I am saying that if UV coordinates are not behaving the way you want, the problem might be in the way you have your shaders set up. Or in other words, I am saying that most likely you don’t know how to use the shaders in Unity/Unreal. I don’t use Unity or Unreal myself, so I cannot advise you on how specifically you should use them, but I have no doubt, that you can have the UV coordinates repeat outside 0 to 1 range.

You can pretty much do whatever you want with UV coordinates. For example: on a daily basis I use a cycles shader that takes the UV coordinates and randomly per object ID distributes them along the width of a texture containing a number of different floor boards. It scales the width of the coordinates accordingly and randomly flips them in x or y, or x and y axis.

Most common way would be to use the 0 to 1 range. It is also common to scale the UVs outside that range if you need a repeating texture. Decide what is easier for you with the shaders you use. That will be the preferred and correct way.

It does work in UE4 if you’re talking about tiling UVs outside of 0-1 UV space. Your lightmap UVs created from these UVs might be slightly inefficient but you can create your own if that’s the case.

Hi again,

Thanks Cyaoeu and MartinZ for your replies.

I have just retested creating a plane with UV’s outside the 0,1 boundaries and it does actually work with Unity standard shader as well. I am not sure what went wrong when I was looking the tutorial and moving the assets to Unity / Unreal.

But yes, you are both correct. Scaling the UVs outside the 0,1 boundaries do work.

Having thought this a little bit I think this is valid workflow if you have a tileable texture, but e.g. if you want to paint the texture I think you are going to have difficulties if the boundaries are not inside 0,1. Am I correct?

Cheers, Jax

Yes, you are correct. Also the scaled UVs will not work for any kind of baking obviously. You can, however have multiple UV maps per object usually, so you could use this anyway if you wanted to. However, if you stick to 0 to 1 range and tile your textures using the shaders instead of UVs you will not have to do any additional work if you need to bake something. It’s up to you to decide what’s best for your specific purpose.

Thanks again MartinZ,

Awesome stuff. I keep this in mind.

Cheers, Jax