Baked texture gets blurry

So im having this issue when baking textures. When i bake large objects the result gets blurry, if i make the object smaller or separate it to smaller objects, then the result become sharper, but it will take forever to get it done.

when i scale up the UVmap it looks really awesome, but then im having an issue with painting the 3d model, because the UV is stretching beyond the imagetextue.

in the picture you can see on the right side the result i want, this is the image scaled up with mapping node.

on the left side you can see the baking result, it looks terrible.

What is the correct workflow for texturing large objects (export to unreal game engine)?
if i make a building, do i have to bake it in smaller separate objects?

I’m not at home right now but that is a thing in settings. it blurs the edge pixels to help with matching up the edges if for some reason they are not perfect after moving to another program. ill try to look up the name and location of the setting when I get home.

edit: set margin setting to 0, if you don’t see bake then you might be in the eevee engine, switch to cycles.

The issue may be the resolution of the baked image. If you apply an image to a small object and a large object, it will look more detailed on the smaller one which is taking up less screen space. Obviously for a game engine, you want to use smaller texture images, but there is a trade-off here.

An example:

In reference the the previous response about the margin setting, both of these have the same margin (16 pixels), but I do not think this is what you were concerned about. It only matters if you have UV islands close to each other and the bake overlaps them.

When i tried a 8K Bake it makes it even sharper, but again, i dont think i should go any higher than 4K.
If i scale up the UV on a 2K texture, it still counts as 2K ?

So maybe modular builds with smaller objects is the way to go.

If I understand correctly “scale up the UV,” you mean to tile the image. This is indeed another way to do it if the image is tileable (no seams). For instance, if you have a 256 or 512 pixel image of bricks or wood slats, you can cover a whole building by tiling it. You would not want much variation (like a lighter colored brick) as this would cause a noticeable pattern.On the other hand, breaking up the side of the building with windows and doors, and having objects in front of it (trash cans or light poles) will make patterns less obvious.

Breaking the model into smaller pieces is essentially doing the same thing. If you have a wall that is 3 meters high and 9 meters long, breaking it into 3 parts (3x3 meters) and using the same texture on each will tile the image three times on the wall.

You also mentioned exporting to a game engine, in which case you want smaller and fewer textures/materials. Lets say you had a brick wall, a wooden fence, a sidewalk, and a street. Using tileable 256x256 pixel images for each would reduce memory usage rather than using non-tileable 2k or 4k textures. Even better would be to combine these four textures into one 1024x1024 pixel image to reduce draw calls for the graphics card.

I just wanted to add you can add seemingly random tileble variations to brick by masking it with a repeating or generated image like noise.

and also the reason scaling the bake up makes the margins small is (I have a post up towards the top) the margin settings are being kept the same when you scale so that sliver of margin on your 4k is the same length in pixels to your 512. thats the only reason the margins are smaller but really why are margins even an issue? I tend to keep mine on 3 or 6 pixels.

Yes, margins are meaningless unless they cause overlap. I brought it up only because you suggested setting it to zero, and I felt it would not address the OP’s original issue.

Overlaying textures does break up the repetitions. Also check out this for use with arrays from Midge Sinnaeve:

But if this is being used for a game engine, this wold not be a great solution because you would need different image textures for each object.

I think I misunderstood the initial question, you’re right about scaling the resolution of the image you’re baking. I thought the op was upset about the margins, like he wanted perfect and sharp UVs or something.

edit: also I though games did use masking like with painting terrain. How are textures for terrains most commonly stored in modern day games? I always thought a good way would be to have multiple tiled textures and then a mask for each. I have no idea in the end but I’ve been trying to get into game programming. been thinking of armory.

Terrain materials start off like any other material with image textures. Textures can be blended with offsets and such so that tiling can be hidden. Unless it is a desert landscape, there will also be lots of stuff around (buildings, dirt paths, piles of equipment, trees, bushes, grasses, boulders, rocks, pools of water, etc.) which help distract from the ground mesh. Having someone shooting at you helps as well.

I have been following Armory for a while (almost since its inception), but I am not a programmer, so interfacing with it has been a roadblock. I have used UE4 and its Blueprint system (node-based programming), and if you have not used UE4, I suggest you give it a try - if for no other reason than you can download AAA game assets, open them up in UE4, and dig into them to see how they do the things they do. This includes C++ files which allow for many more things than Blueprints alone.

I want to stress that I am not promoting UE4 instead of Armory. I want Armory (or anyone else) to succeed in provide a complete game building pipeline based in Blender. Game dev is a highly specific task with many needs inherent to the process so I do not think Blender will (or should) try to tackle it themselves for 2.8+ (RIP BGE). By comparison, the modeling you an do in Blender far exceeds what is available in a game engine, for the same reason - different tasks, different needs.

I used unreal engine back in high school when touch phones first started showing up, didn’t know enough about programming back then to actually do anything in it. The most programming I have dove into this past year is python with blender. I know a little bit about basic stuff but I try to avoid programming in general. Armory and Unreal offering a node based system is attractive but at the same time I at least know enough about programming to understand that you can do more with programming. I’m interested in Armory because I’ve been spending the last 10 years of my life in blender and the idea of a more modern game engine being implemented into blender seems like a dream come true but I hear a lot about how Armory isn’t ideal.

To add a bit:

Please make sure you work with a metric system and have set it up correctly (the article linked will tell you why). The resolution is simply the result of the texture dimensions you baked too. What you did was a texture, that you think was big enough for an 3D object, but technically needed more pixels available to represent itself 1:1 on the screen. To get rid of that problem once and forever and also consistently all your meshes, have a read about “texel density in game engines”. Also try to get the Addon “Texel density checker” or “TexTools for Blender” that will help you a lot with this matter.

A quick overview of the problem you facing and how to get over it:

Thanks for the help :slight_smile: When it comes to baking i think i got the hang of it, but there seems to be so many ways to texture a model, i struggle to find the best workflow that fit’s my need. Btw. Im using UE4 as game engine.