0
$\begingroup$

I have a recurring issue where my textures, although seemingly high enough quality, appear very grainy and low-res when applied to a model. However, I've found that scaling the UVs up excessively makes the texture appear way higher fidelity on the model, but I'm pretty confident this is a terrible way of doing this. Am I missing something obvious? For context, I have my Unit Scale on .01 (for exporting to UE4) and the barrel is currently a very large barrel coming in at about 2x2x3m, if that changes anything.

Pic 1: UVs scaled up large

Pic 2: Result of large UVs, much higher quality texture

For comparison, it looks pretty bad to me when the UVs are scaled "appropriately":

Pic 3: UVs scaled "appropriately" within the bounds

Pic 4: Awful low-res result of normal UV scale

$\endgroup$

3 Answers 3

1
$\begingroup$

First, I'll note that by default, textures loop endlessly. Given that, despite the fact that your UVs are "off the texture", the texture is still being applied with the same coverage, just at a different scale.

To fix your issue, you may want to employ a Mapping node.

Setup

Let's start with the node setup;

enter image description here

Note: for the "Type", I've selected "Texture", since I want to apply scaling at a factor relative to the image dimensions.

Examples

The default value for scaling on the mapping node;

enter image description here

Higher value;

enter image description here

Lower Value;

enter image description here

As you can see, no modification of the UV is necessary. Technically, it's exactly the same result, but the effect is applied via a different method.

Alternate method without nodes

Open up your favorite image editor. Load the texture;

enter image description here

Expand the canvas size by 200% (or more, depending on the desired resolution);

enter image description here

Copy the image into the empty space;

enter image description here

Save, use as texture, enjoy increased resolution at the cost of disk and memory, but not having the mess with equivalent nodes in two programs.

Scaling two textures differently with the same UV

Ok, starting with the following node setup;

enter image description here

I've painted some wood onto this burlap cube using the MixRGB node, and a black and white image as the factor (black indicates 0, white indicates 1, grays in the middle indicate a mix);

enter image description here

Now I can edit the mapping of each texture separately. Here we have enlarged wood, and reduced burlap;

enter image description here

And now, the opposite;

enter image description here

I do not know if there is an equivalent node setup in UE4 One might suggest considering baking these textures, and exporting this object with it's own set of textures. Of course, that means more textures, and memory, and etc (and I think you wanted to do this programmatically, not just throw more textures at it).

Blender file for examination

$\endgroup$
14
  • 1
    $\begingroup$ Yes, you would have to scale the image in Unreal the same way, otherwise the texture will render differently between Blender and UE4. $\endgroup$ Apr 2, 2020 at 19:01
  • 1
    $\begingroup$ I see. Yes, then the addition to my answer won't do :p . I can't see your node setup in UE4, because that image is microscopic, but if there's a way to scale just that one texture, not the entire shader, then that would be what you want. Alternatively, if you could assign one UV to a texture, and another UV to another texture, that would work. $\endgroup$ Apr 2, 2020 at 19:35
  • 1
    $\begingroup$ I mean, I can show you how in Blender :p I don't know UE4. Stand by, updating answer... $\endgroup$ Apr 2, 2020 at 19:43
  • 1
    $\begingroup$ Updated my answer $\endgroup$ Apr 2, 2020 at 20:04
  • 1
    $\begingroup$ I've also attached the .blend file for you $\endgroup$ Apr 2, 2020 at 20:07
1
$\begingroup$

Instead of directly connecting the UV Vector output from the UV Map node to the image input in the material nodes, insert a Vector > Mapping node. You can use it's scale component to scale the existing UVs, or move/rotate them.

For scaling only a Vector Math node set to multiply will do just as well.

mapping node demo

This will obviously not work in an exported object for another program without corresponding material nodes.

$\endgroup$
1
  • $\begingroup$ Cool, thank you! So I should just re-create this setup in UE4 in a material, correct? $\endgroup$ Apr 2, 2020 at 18:56
0
$\begingroup$

There's no issues at all (that I've ever encountered at least) with scaling up your UVs. This is a common way to deal with tileable textures. Another way is to scale the texture in the material settings, but this does the exact same thing, just behind the scenes, and probably won't export as nicely.

One thing to consider is you also don't want higher texture resolution than you need, as it could impact performance or memory usage. It's very common in games to be able to see the textures get a bit grainy when up very close, so just keep that in mind.

$\endgroup$
2
  • $\begingroup$ Thank you, very practical answer. Is 1024x1024 a reasonable average for most textures, and maybe higher (2 or 3k?) for high-res stuff such as player and weapon meshes? $\endgroup$ Apr 2, 2020 at 18:57
  • 1
    $\begingroup$ There's no one size fits all method for texture size that I know of. Generally you start with figuring about how detailed you object needs to be and go from there. You can also use some techniques to reduce the texture size needed, like stacking your UVs on top of each other. $\endgroup$
    – Brenticus
    Apr 2, 2020 at 20:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .