This is my first time unwrapping a house, and I feel like this is not the proper way to texture it. I tried to unwrap it so each piece has UV space, but that led to low resolution, and a lot of frustration. Here is a picture of my current house (the texture are just there to show the different materials used) , uv layout, picture in UDK, and my unwrapped model. The flats are separate, the one shows my material spots, and the other is my UV layed out overtop.
Hopefully it can show what I am asking, is this the proper way to do this sort of thing? Also how would someone use a AO map with this sort of thing?
Thanks!
Replies
Thanks for the reply. I had a hunch the AO would be a second UV channel.
I am a little unsure of what you mean by using multiple textures though. Would you have to have the meshes seperate? Ie. Windows/window sills mesh, roof mesh, house bottom mesh each with their own uv's/texture sheets, or is there a way to have a single mesh (like mine) with multiple uv's and texture sheets?
*If you still not sure about what I say, I can show you with my model what is using multiple textures/mats.
And here is an example of one texture and its uv's (edges are not visible, but you can see what is happening):
The plaster parts are uv'd like this (filling the whole uvmap). The another textures uv's are also filling the whole uvmap or almost the whole.
I UV's the bottom half put it into the UV channel 2, the rest of the mesh was on another UV unwrap and set to channel 1 . I made two simple textures in PS. In UDK I set up the material (as I saw in some PolyCount threads regarding multiple UVS's), but nothing is working , it just shows one texture no matter what. I even tried this with a simple box model but it was a no go still. I tried changing to all the different map channel variations (1,2,3 etc) in the Tex Coordinate nodes also.
Here's another photo to.
I probably messed something up :P , thanks for taking your time to help.
Anyways, use a multi sub object. That way, you have the roof as one whole texture, the frame of the house as another, and maybe have the windows and doors as another texture sheet so as to not have this resolution loss. Like this:
A multi sub object is like have a bunch of separate materials, just all loaded under one material. You'd apply them to the house by selecting each part first; ie, roof, then house, then door/windows. It might be easier to detach everything, but after you select one section you'd apply the specific texture to that part. Apply a UVW modifier and unwrap like normal.
Quick side note: Since a multi sub object houses so many other materials you can simply swap them out in UDK to create variation to your models. Or do the opposite and use different models using the same materials.
Additional UV sets from memory will contribute to performance cost from memory, as does assigning multiple shaders/materials to your meshes. I don't know how much and in your case it may not be noticeable.
The way you had it originally set up was fine, I'm not sure what benefits you are gaining from using multiple materials to break your texture up. If you are using bigger textures then why not use a bigger single texture in the first place? Keep in mind the textures should be 256 512 1024 etc, if you don't use those dimensions it still counts once it's on the gpu, 800x320 becomes 1024x512. By using less textures you also cause less state changes on the gpu by preventing it from switching between textures to render. Some extra triangles probably won't harm performance as much so if you have a repeating texture you could add splits such as the roof for example and overlap the split uv's ontop of one another(or offset by 1/-1 in UV space if you're baking textures).
For AO, you could also bake to vertex colour, depending on quality you are after. This would not require an extra uv set and not be affected by tiling, but won't be as detailed/crisp.
Hope that helps, I could be wrong about some of these things. I mainly wanted to counter Obscura's first post, this is coming from what I know with mobile game development in 2D using the GPU on quads/planes. You also don't have to have the uv's for your mesh all spread out in the 0-1 UV space, as I mentioned above you can overlap uv shells to share the texture content, it'll make your texture on the mesh look sharper/higher quality than how you have it right now. The tradeoff is by sharing the texture content between the uv shells you cannot have unique details without using other options like shaders/uv sets/vertex paint.
http://www.polycount.com/forum/showthread.php?p=1815164#post1815164
I really don't understand what is your problem with using multiple textures on one mesh. Its really useful if you want to reuse it on anything.Like on multiple different houses for example. And with this, you can tile the texture without adding extra edges.
The reason I advised against it was performance impact, multiple textures for one is going to cause additional draw calls from the state changes, as for each rendering pass it has to switch between the textures for each material you add on top, this might be different from the engine I use but it prevents batching. And when you upload the textures to the gpu, if any textures are not power of 2 it is still treated as if it is, which wastes memory.
It might make sense if you have a smaller tiling texture of say 128x128 while the rest is 512x512. Correct me if I'm wrong but if the 128 doesn't fit into the 512 properly than you'd get a 512x1024/1024x512 texture, plus it wouldn't tile in both directions without uv splits(which is increases vertex count). And then if you had 4 of these 128x128 you could have a 256x256 with them all, or use seperate textures/materials for each. Alternatively you could use a single 128x128 in grayscale channels RGBA and with a shader and a gradient map have 4 tiling textures in one texture with the cost of the shader instructions. When you have a situation like this, I'm not sure what is the right choice, if there is anyone more knowledgable on the subject that can chime in that'd be great.
This is all stuff most artist may not think about, it's more of an issue if you are making art for mobile devices. If you are just doing single assets for portfolio you won't have any problems, if you make a game and have many assets done this way, you might see problems depending on the hardware.
Using multiple textures and materials can be faster to iterate with which can be good, only on a big project are you going to regret it if you have to go back and optimize.
I have no idea about PC on a large project, depends on the players you try to reach. MMO games for example usually try to reach the broader player base where their computers aren't as powerful. I have worked on some pretty basic 3D games where the performance was pretty bad probably because of reasons I have talked about here and possibly because of the programmers we had(we were all students still learning). I'm not sure what an asset heavy game would perform like in unity/udk if you approach majority of assets in the way you do.
@Obscura, Thanks for the tut.I really appreciate it, and I'm sure others will benefit from it.
@Chase Great explanation to, really helpful stuff.
@Pola, ya this is just a personal project. I am working off a concept. I'm going for a more .. unoptimized prettier scene, than a optimized correct scene :poly136:
Or you could use Mask-Maps in your RGB channels.
Also, while they're not cost efficient on 1 house alone, they are efficient on many buildings, since many of them will use the same textures in difference places, outside of an extra Material-Link which might change the colors or number of tiling slightly, they're the best option, especially for a full city.
The best option performance wise would be to manually setup everything. Put in mutiple generic tiles in one texture sheet that reach's the end of the UV space either Horizontally or Vertically, and tile your UV's from there manually from one side.
Crysis 2 did this alot for their environments iirc.
In the 2D framework it was best practice to keep as many assets using the same texture/atlas and avoiding a state change. With a mesh/material you're going to be going through several textures such as diffuse/normal/spec, so not sure if rendering is done stepping through a material and iterating through it's textures or not. I'm guessing it doesn't matter what the mesh is, all meshes with that material are rendered for each pass, but what happens when you have multiple materials to a single mesh?