So, once again, another installment of this ongoing accounting of modding Sins of a Solar Empire. Today’s update is primarily concerned with on of the latter portions of the modeling process and early portions of the texturing process– or, if you like, a transition step between the two. I’m speaking of that most esoteric of tasks, UV mapping.
UV issues are one of the things I see and receive more confused questions about than nearly any other topic in 3D or game art, so I think it’s worth taking advantage of this opportunity to talk about it a little. UV mapping, for the uninitiated, is a necessary step(particularly for game models), which applies the 2D image textures to the 3D models. To put the topic in brief, you flatten out the 3D geometry and arrange it on a plane. This is done in a special coordinate space(UVW instead of the XYZ that the actual geometry exists in), which tells the rendering engine what portions of a given image go on which polygons. This is something game models absolutely have to have, since they’re pretty much always textured with images, unlike pre-rendered models, which don’t necessarily have to be done that way(but still often are).
Games further have the constraints of being realtime-rendered by video hardware and the like, which means there’s a more restrictive limit on the number and sizes of textures that can be used and on the whole, the UV maps need to be built efficiently, trading off between image quality and the available texture memory resources. Which basically means that it’s very important to fill as much of a UV map as possible and pack everything in very tight and neat while still making it relatively easy to paint the textures. This is further complicated by a whole host of hardware and API-related weirdnesses that may or may not be a major concern.
To the right is the finished UV map for the Astraea. I am by no means an expert at UV mapping– I still have a lot of room for improvement– but I’ve also been doing these things for a while and have already learned a lot, both from fellow artists and from the process of actually doing it for myself. The left screen shows the UV map, the right screen is the 3D view.
There are a couple of tips worth sharing here, though I’m not writing a how-to on the subject. The first is that, as the picture shows, I work on a dual-monitor setup. This is invaluable. I can’t begin to describe how good it is to have the extra screen real estate, and how useful it is to have a nice, clear, large view of both the 3D model and the UV space while working. It makes the whole process of selecting things, mapping them and adjusting them just tens of times less painful. The other major tip here is applying a checkerboard image over the entire model. This does two things: First, it makes it easier to see which parts are already done and which are not, since in most packages anything missing UVs will simply not display the image. Second, it makes it very easy to see if the UVs are resulting in texture distortion due to the projections used, and makes it quite a lot easier to ensure a relatively uniform distribution of texture over the model(if all the checks are around the same size, then the texture is probably pretty evenly spread over the geometry). There are, of course, places where one might purposefully distort or enlarge the texture space, but the checkerboard helps avoid accidentals.
This, of course, all necessitates exporting the model again. Fortunately, since all that’s changed is the model, that just means kicking out a new .mesh file and replacing the old one– all the entity files should still be in good shape. While I was at it, I took the time to get the smoothing across faces sorted out and cleaned up so that the shading is working a little better. I also took a shot at generating the tangent map as per Ironclad’s instructions, but unfortunately the XSI Mod Tool kept giving me an invalid command error every time I tried. So as a workaround, I set the .mesh file’s HasValidTangents to FALSE to let DirectX generate them. Not the preferred solution, but it works. And as long as I was doing all this, I made some changes to the meshpoint positions to take care of some of the particle clipping I was seeing in my last post. Some of it is still there, but to a much smaller and more acceptable degree than previously.
With the new export, time to look at it in game again and make sure it’s all gone to plan, and so it has. I think anyone would agree that it’s looking a lot better than it was the last time I took screenshots. Next up: Texturing.
PS: Is this the right category for this? Is there one? Should this go here, Dev Journals, do we need a sub-category for modding to put these Impulse-spawned blog-posts into? Does anyone care?