A Photo-Centric Approach to Modeling and Texturing

0

Introduction

This document will describe a technique for game asset creation that focuses on using as much photographic information as possible, in order to easily create detailed, interesting, and above all realistic looking models.

Traditionally game assets have been built as geometry first, with texture being a separate phase that comes only after the geometry has been finalized. Often modelers will even create high polygon geometry and project it to a normal map before texturing of the diffuse is given much attention. This separation of modeling and texturing has persisted from the days when texture memory constraints were such that texture could only hope to give a vague impression of a surface, and was therefore often painted by hand. But now that models have much higher texture memory budgets, we have the freedom to use more photographic detail. But to make the best use of photographs, we must do more than change our texturing technique, but in fact change the entire process of asset modeling as well.

The image below shows a rectangular engine that was created this way. We will walk through how this object was made.

projectionmodeling_final_result_a

Concept and Photo Gathering

We begin, of course, with the concept art and the placeholder object that already exists in game. The placeholder is simple geometry that has certain precise measurements that should be maintained in the final mesh. The concept art gives an impression of the kind of detail that is expected to be on this object. In this case however, the exact shapes drawn in concept are not important, and can be changed in texture. The most important aspects are that it is flat enough to do a wall jump on from any angle, has enough empty panels on the sides and the back so that pipes can be put into it by level designers, and does not seem to have anything from which the player can grab and hang. Of course, different assets will have different flexibility in regards to how precisely the model must match the concept art, and this should be ascertained through discussion with the art director. For example, characters and weapons are generally designed very meticulously in concept art, and their models cannot diverge much from that design. But many world objects are much more open to change. The greater the flexibility, the more possibilities arise to use photo source well. A modeler should not assume that what is drawn in concept is set in stone – good photo source often trumps the details drawn in concept art, and leads to a change of design that vastly improves the model.

projectionmodeling_concept_and_placeholder

In the traditional approach to asset creation, a modeler would build the shapes that were drawn in concept as closely as possible, and then create the texture around those shapes. But instead we begin by gathering photographs that contain appropriate mechanical details. Don’t look for just surface types, like generic rusty metal, but also larger forms, like arrays of knobs and dials, bunches of pipes, and entire sides of complex machines. A great many of the images used for this machine came from a photo shoot at a local train museum, but others were found in stock photo collections and in online photo sites like Flickr. The goal is to collect enough photographs to create a digital collage in Photoshop that will be used as the basis for both the texture and the geometry of the asset. Here are some of the key photos that were used for this object. Keep in mind, however, that for every image that is actually used, there are many more gathered which are put aside.

projectionmodeling_photo_sources

Creating the Texture Previz

Next, we take an orthographic screenshot of the placeholder machine’s front, standing next to our character for scale reference.

projectionmodeling_ortho_solid

Resample this up to a high resolution. Here we made it about 3700 by 1800 pixels. The point is to have the previz we make be higher pixels per meter than the actual texture sheet we make, which in turn should be higher than how it will be brought into game.

From here we begin compositing our images together into something that looks good. We try to use larger and more complex chunks of photographs to maintain actual structures from our images. It can be handy to temporarily work beneath a desaturating adjustment layer to keep from being distracted by wildly clashing colors from different photo sources. We arrange the elements densely and inset enough that they can act as a solid flat wall for purposes of wall jumps and other collision.

projectionmodeling_previz_desat

Once the placement of details has been solidified, we remove the desaturation and change the colors and brightness values with an assortment of other adjustment layers. Color Balance layers are particularly useful here, because they maintain color relationships while changing the overall chromatic tone. Keep in mind that further refinement will be possible later in the process, but a decent approximation should be achieved here.

projectionmodeling_previz_finished

Here the base hasn’t been filled in, because it is intended to call the same texture that is used on the top. Also, the vertical element on the left is deliberately doubled, with the intention of tiling that part of the texture.

Projection Modeling

We now have enough to begin modeling in 3DS Max. We add a UVW Mapping modifier using planar mapping onto the placeholder model, and set it to affect Map Channel 3. The first UV channel we are reserving for the actual in-game UVs, and the second is for lightmap UVs, so we have to use the third for our construction purposes. We then create a material using our previz image assigned to Map Channel 3, apply it to the mesh, and adjust the mapping gizmo until it lines up perfectly.

projectionmodeling_placeholder_projection

A Mesh Select modifier is added below, in order to negate the face selection that happens at the base level. This ensures that the UVW Mapping modifier affects the whole model, regardless of face selection. There are several other modifiers available that have the side affect of negating selection, and any of them will do, but Mesh Select is a particularly harmless one.

Now we go into the base level and begin modeling to match the shapes in our previz texture. Keep the “Show End Result” toggle on. The planar projection will remain consistent as you model. In this way, you can line up your geometry to exactly match the shapes in the previz to which they correspond. Here is the outcome.

projectionmodeling_projection_modeled

Keep in mind that for more complex models this can be done with multiple projections from different angles, by simply stacking UVW Mapping modifiers that can be turned on and off, with various alignments and gizmo positions. Each requires a separate material with separate previz textures that can be swapped over the model. This can be a bit more difficult to manage, but it allows for many angles of a model to be built with projection modeling. A good example of this is the Half Track vehicle, many sections of which were created this way, projecting from the side, top, and rear.

half_track

Returning to the Rectangular Engine, we now UV map these front elements with actual game UVs in the first channel. Certain elements like the pipes will need their own unique texture space because you can see around and behind them. Other parts that can’t be seen around can be mapped planarly with their neighbors. In many cases the sides of these don’t need unique texture space, because they can be overlapped onto existing texture later on. For now, don’t worry about the parts of the model that weren’t included in the projection, such as the base, but leave enough empty space in the UV layout to account for any planned parts that won’t be reusing texture. We temporarily scale these UVs down and put them somewhere of the way, where they won’t overlap the parts we’re working on.

projectionmodeling_uvs_a

We can now use the Render to Texture tool to project from the previz in the third channel to the first. We make sure that some padding is given, so that we get proper bleeding at the UV edges. This asset is intended to have a 1024 x 1024 texture in game, so here we render it out at 2048 x 2048 so that we work in Photoshop on a version that is twice the resolution. This is generally a good practice to maintain when RAM constraints allow, because it results in a higher fidelity image, is more forgiving of destructive transforms, and allows for a last minute switch to a higher resolution in game if it suddenly becomes necessary.

projectionmodeling_render_to_texture_dialogue

Here is the resulting image projected onto Mapping Channel 1.

projectionmodeling_projected_dif

From here we can model, UV, and texture simpler elements like the floor grating in a more traditional way (while still using photo sources), but we now have all of the pipes and other mechanical parts at our disposal to reuse here. This gives us the freedom to cut in to the floor and insert all this detail, without incurring any extra texture memory cost. We rearrange and pack the geometry together so that the character can walk over it as if it were flat.

projectionmodeling_floor_construction

Now we UV and texture the side, this time without projection, but still using photo source as best we can. To conserve polygons, only the largest shape at the bottom is given geometry. The rest will have only the texture, but with the panel inset so you can’t see it edge-on, it is enough to maintain the illusion.

projectionmodeling_side

Of course, many parts of the detail geometry did not face directly at the projection, and therefore do not have appropriate texture. This side view of the bottom shows the problem well.

projectionmodeling_unprojected_sides

For these parts, we position the UVs over pre-existing texture wherever possible, and create new texture in the UV space that remains, when necessary. During this step we can also make slight adjustments to the UVs that are in the planar projection so that inappropriate bleeding is minimized. Here is the result.

projectionmodeling_unprojected_sides_fixed

Even after doing this however, there is a great deal of cleanup that is required. The parts that were given unique texture space, such as the pipes, have problems on the edges that are oblique to the projection alignment. Also, they currently have doubles behind them, where the projection put the image through them to the inset wall. Through clone-stamping, painting, and other standard Photoshop techniques, we remove or fix these errors. When combined with the texture for the newer parts, the resulting diffuse looks like this.

projectionmodeling_engine_rectangular_dif

Normal Map and Specular

Notice that until this point, we haven’t touched the specular or the normal map. Both of these maps are entirely reliant upon the details in the diffuse, and should therefore wait until it is finished. There is no high polygon model to project geometry into a normal map, and in fact a normal map that is too heavy-handed can be very detrimental to something like this, ruining the photographic detail. Certainly a normal map should be used, but only sparingly.

For creating these maps well, it is vital to preview the model in the game engine. While 3DS Max does have tools for viewing specular and normal maps in the viewport, the result is very different from what happens in the engine, and should not be relied upon.

Most of the specular is achieved by using various adjustment levels to desaturate, brighten, darken, or otherwise change the diffuse. But for the large swaths of metal plating, this can only go so far, and does not create a compelling enough surface. Generally, good photo reference for texturing is deliberately taken with the specular highlights minimized, because it is undesirable to have specular baked into the diffuse. Unfortunately, this means that some improvisation is often necessary to recreate a quality specular. Here we have overlaid some scratches and grime from other metal photo source on top of the original plating.

projectionmodeling_engine_rectangular_spe

The result is detail that comes through only in specular, which is a far more interesting thing to see.

projectionmodeling_spec_ingame

Aside from the primary specular, we also apply a generic blurred cubemap that we keep in our Global Materials package for many reflections in our world. For an object such as this, a separate reflection map is not necessary. W e can reuse the specular map. The goal isn’t exactly to create a reflection, but just an extra specular component that comes from many directions and isn’t reliant upon lighting. This guarantees that the surface will have some amount of shine on it regardless of how it’s lit. Here is the material setup for this.

projectionmodeling_material

The normal map we create by iterative use of the Nvidia Normal Map filter in Photoshop, applied mostly to specialty elevation layers which are painted by hand over the most prominent features. The opacity of these elevation layers are then used to mask the resulting normals, which are stacked upon each other (by halving the brightness of their blue channels, and switching to “Hard Light” mode). Masking in this way results in relatively hard edged normals, which otherwise would have unrealistically soft transitions.

Particular care is given to the sheets of riveted metal, where we paint dents and bumps. The more sparsely spaced rivets in the middle are each given their own bump inward, as if the act of riveting bent the metal each time.

projectionmodeling_elevations

These elevation layers are only done on a few prominent parts of the texture, not for every little rivet, seam, and screw. The goals is simply to have the largest forms display proper lighting from oblique angles to maintain the illusion, but not to interfere with the much more realistic lighting that is part of the photographic data.

A global pass of the actual diffuse through the Nvidia filter is done, but the result is given a very slight opacity, so the effect is only perceivable under the most extreme lighting situations. Here is the final normal map.

projectionmodeling_normal

It can be useful to switch back and forth between previewing with full texture and only with the normal map to see more clearly what the lighting is really doing.

projectionmodeling_nor_preview

Finally, we create a collision mesh and an LOD mesh, which is about a tenth of the poly count. The planar mapping of most of the front elements helps a great deal with polygon reduction for the LOD.

projectionmodeling_lod

Now the Engine is complete.

projectionmodeling_final_result_a

Conclusion

The process of projection modeling with a premade texture that is described here can be very useful, but is certainly not intended to supplant entirely the traditional way of working. It is merely another technique in the assortment that an artist can use. The most important thing to remember is simply that photographic sources are almost always more realistic than anything that can be modeled or painted by hand. To use them to their best potential often requires a loosening of the conventional process, and of the conventional stages of asset building. Often the best result is achieved when modeling follows texturing, and texturing is based as much on available photo source as it is on concept art.



No Comment