Need advice for UV/texture separation for game engine


#1

Hello. So i started a “game” project just for practice (it won’t be a real game)… yet…
I’m not familiar with game engines and memory optimalization. So i need some advice how shoud i make the textures
The idea is that the weapon parts will be seperateabel. I started UV-ing it and I got stucked… Should I make all the parts pust in one texture or all segment should has it’s on texture?
Which use less memory and calculation?
I made a picture if it’s confusing what i asked…


#2

In terms of compression/memory efficiency the first one is best in case all part are always loaded together.
If the parts are not always loaded at the same time (like putting a different scope on a gun or something)… then its better to keep the textures separated and scale the dimensions down accordingly.

As far I know though… maybe someone with more experience knows a reason to do it differently.


#3

Well, yes. It will be like “scope on a gun” ,so not always loaded at the same time. The blades, handels are changeable.
Just when i puted 1 blade on the uv grid, i noticed ther are so much space around it. Should i separater all of them? or if there is space, should i put them thogether?
My main “fear” is the unused pixels in the separated textures


#4

I think/assume the texture compression is smart/good enough to make the unused space in textures not take too much memory… (as long as you keep it empty or fill it with a plain color).


#5

Nope. Minimizing unused texture space is still very important for game textures. Compression can only do so much.


#6

It doesn’t look at unused space, it uses the whole square, as even untextured space is still a loaded texture.
Foe a game, If your character uses those props, you can just put those pieces on his main texture. Even if he doesn’t use them, it will be one texture, and usually there’s enough of free space to put small elements there, as big pieces don’t combine too well.
The first unwrap seems the most logical, but usually you put elements vertically or horizontally, as it’s easier to texture later. It’s not very convenient to texture if your clusters are rotated diagonally, as you will have to adjust your workflow each time to their orientaion.
Then it’s better to make those red-outlined elements with all edges straightened. In uvlayout you can make it with one-click, not sure about other unwrappers. Though it won’t correspond 100% to the mesh, it’s not a big deviation, and if you want to put a line or an element, you will have a choice making it in uvw, rather than just in the textuing program viewport. Usually it’s a requirement to unwrap such elements this way, unless they are quite irregular. But for hoses, cyllinders it’s a common practice.
You can decrease the size of the longest element by 10% (even up to 20%, if it’s not the character’s face), to fit it in the uvw. The difference won’t be too big to notice.
The rest of space can be left for future props if added. This way you can put a bigger element later if you need.

Also, you should think about the padding, i.e. how many pixels the clusters (pieces) apart. The smaller the texture, the more padding you should leave. As when the model is far away, the engine will use mipmapping -decreased versions of the texture, so pixels will be blurred together, producing edges artifacts.


#7

Sure, but having an empty (or plain colored) area is one of the easiest and most basic things in terms of compression. I’d assume it takes close to no extra memory at all…
If not, that’s kind of really bad texture compression.
There should be a way to test this I assume

Sure, but it doesn’t matter when it takes up no memory… right?
It also can get kind of messy when you got like 5 different scopes and 5 different grips etc… in the game and their textures are all included on textures of different other objects.


#8

Ok, after some quick experimentation with nvidia’s DDS plugin for photoshop I came to the conclusion that empty space/plain colored area’s don’t get compressed as efficient as I thought.
As a matter of fact a photo with plain area’s drawn onto it takes exactly the same amount of space as one without them…

So, I was very wrong to assume it doesn’t matter much… :blush:


#9

Thank you mister3d, ACiD80 and Meloncov for the advices.
And mister3d thanks for the tips with the unwrap. I’m a beginner in uv-ing models. i dont have a proper workflow yet.