Hi, I haven't found much information around on these things so I'm going to ask them here!
(1) When doing UVs for buildings, is it much better to use overlapping UV's (or tiling textures) or are most games steering away from these and having unique UV's for all polys? I'm thinking current/next gen games with massive use of normal/spec maps etc.
(2) For terrain, I guess tiling textures are still required,. Is most terrain texture generated from a blend of multiple maps? With different tiling counts? Does each texure that is blended have different UV's then? How many blends are usual in a detailed terrain and thus how many blend maps? As you can't bake lighting into tiled UV's I'm guessing that multiple UV's are used for this....?
(3) What are the differences/advantages of overlapping as opposed to tiling? Is tiling supported by most engines?
(4) How many UV channels are typically supported by engines?
That's about it for now, I know theres a lot of questions and it's not possible to answer for all engines as they have different capabilities, but any help anyone can give using their experiences in the industry would be appreciated. As would any links to any tips on best practices for this sort of thing!
Thanks and regards
Replies
1. Usually... tiling for repeatable details, decals to break it up, and lightmaps for unchanging lighting (ambient occlusion, constant lighting & self-shadowing).
2. Yes, blend of multiple tiling maps. All using same UV is more economical, though many engines support per-texture local UV pos/rot/scale within the base shared UV. Usually around four bitmaps can be blended together. Games use usually either vertex color to blend the maps, or they use RGBA channels of a blend bitmap. Lightmap requires its own dedicated non-tiling UV, same UV the blend bitmap uses.
Exceptions... Crysis seems to not use a lightmap. QuakeWars uses !!MEGATEXTURE!! (non-tiling large-resolution bitmap).
Some reading.
http://developer.amd.com/assets/Andersso...MD_Session).pdf
http://reality.artificialstudios.com/twiki/bin/view/Main/MixMapTutorial
http://udn.epicgames.com/Two/VertexBlendingTutorial.html
3. Tiling is supported by all engines, unless there's some weird hardware limitation (mobile perhaps?). Tiling requires the texture to tile at the edges (left-right or top-bottom or both), also uses less in-game vertices (every UV split requires multiple verts, read this).
Overlapping is reusing the same pixels, uses more in-game verts (potential slowdown), but allows lots of customization per polygon/area since the UVs can be rotated/scaled/moved/mirrored differently.
4. We support 99, but I'd never use that many, way too expensive.
That's my experience, other artists around here with more level design experience than I, hopefully they'll chime in.
Also do a search, these topics have been discussed recently.
Currently studying your links, best regards
It lets you veiw vertex blending in the viewport, which is nice for terrain stuff, and it also does multiply and overlay textures so you can have a repeating brick pattern on a wall and then use a dirt overlay that is using a seperate UV channel
here's a sloppy drawing to help illustrate
Anyways, cheers for the input!
Tried to do this with Modo's 3D paint awhile back, but it couldn't do it. Maybe they're improved since then.
Then CrazyButcher wrote a quickie 3D painting tool for his Luxinia engine awhile back. Very bare-bones, but it does the trick.
One of the other artists here was checking out Body Paint 3D to see if it could do a similar thing, it does support multiple UVs (each has to be diffferent material, but you can layer the materials)... but it can't show the results in its real-time view, only with its offline renderer.
It basically involves using the DirectX9 material and the vcolorblend .fx file, then assigning the material used in the render to be 100% self illuminated with a VertexColor shader in the Diffuse Map slot. Then the render to texture output will just show the vertex colors. If anyone's interested I can post some more info on this.
http://www.loopit.org/downloads/vcolorblend4.fx
http://www.loopit.org/downloads/vcolorblend_bump4.fx
The _bump one has normal maps and specularity and looks tasty, nice when painting four different normal channels.
Let me know if it's any use!
I suspect its not so hard to make that script write into single color channels. maybe the texture uploading isnt as responsive as it should so. (wait I think that was the reasion I wrote the texture painter in luxinia for you in the first place )
I also just modified my shader doing the blend4, although I do a bit different I use the sum of RGB to compute a "rest" weight which is applied to texture D. If you dont like that just change the weight generation function. Optionally you can apply vertexalpha as brightness for vertexpainted shadows at the end.
Ah, here it is.
http://boards.polycount.net/showthreaded.php?Cat=0&Number=159459&page=1&vc=1
I'm especially interested in this feature:
"The third technique blends 4 Textures based on Vertex R G B Channels individually. The 4th weight is the rest value that is left (if all others are summed to 1)"
Other nonshader solutions would be also much appreciated.
At some point I'll try to edit it some, adding a shadowmap and some other things. I'll be sure to post the file if I do. Thanks again man.
Also CrazyButcher I'm going to play with the Luxinia tool again when I get a chance, let you know how it goes. Not doing much terrain these days, but will probably do so in about a month.
Glad you had a chance to try the shader Eric! Yeah the specular is pretty hot as I find it easier to see surface details like that, but it's probably not ideal. I found painting very responsive using lower res meshes but with larger meshes even just VertexPaint alone tends to slow down. But certainly the fx file is not optimised at all, would be interesting how it performed in pipelined assembly.
Yes, I would really appreciate any improvements you can suggest/provide!
I also had some luck with displaying zbrush MatCap materials in Max using a custom shader and they look really similar, apart from the cavity detection of course.
Tried to do this with Modo's 3D paint awhile back, but it couldn't do it. Maybe they're improved since then.
[/ QUOTE ]
The way you would do it in modo is by just painting with your textures as you want them to blend, the transparency of what you're painting is stored in the alpha channel (unless you're using a format with no alpha).
You can then take the resulting alpha channel and save it as a proper grayscale or whatever you need for the game engine.
The painting has gotten a lot better in v3 but is still not perfect nor perfectly stable.
As for environment pieces, we use vertex blending here and a trim shader for details. It doesn't give you a custom unique look for all the single buildings and there's some limitations but it was the best i could come up with without using lots of custom textured details that will only work for 1 material etc.
http://www.strangefate.com/webby/dshow.jpg
http://www.strangefate.com/webby/dshow2.jpg
The vertex blending is pretty obvious, i was only given the blue channel as the others were already being used for other stuff. Ideally i would have liked 2 channels so i could blend the bottom of the buildings with brighter dust/dirt or whatever blends better with the ground.
Also i never got around to experiment properly with decals to add large weatheration covering the whole building or on selected areas under windows etc.
For the details i came up with a trim shader which isn't exactly revolutionary. It takes a normalmap and a grayscale occlusion map mapped to UV1 and blends it with the tiling textures in UV0 and doesn't require a new material.
If you have detail normalmaps or otherwise can blend textures and normals you're mostly there i'd say.
The advantage is that it's quick to use and the same trim texture (a 2048x256 map) is used all over the game for all kinds of architecture or even street lamps.
The biggest drawback i found is that people often don't know when to stop, and will either overuse it, use the trims in ways that don't make sense, or use it on pieces that should really have a custom texture and normalmap.
Plus obviously... all shading will go to black from the occlusion, whereas if you skinned the stuff properly, you'd have brighter dirt and soft highlights here and there.
With the right mix of custom and tiling-trimmed stuff you can get some really neat results, it's an easy way to have bumpy details everywhere and higher res textures with details than if you had to make them custom, and cheaper.
http://www.strangefate.com/webby/dshow3.jpg
MoP, about the matcap shader, I'm not really ready to let it loose yet, sorry.
Alex
its nice the hlsl code helps, but I'd urge you to add your name to the fx file, too. Like I am happy you left my name in there for saying where the original stuff came from, but you should also say its not all mine and give yourself some credit for changes made.