Home   CFS 1   CFS 2   CFS 3   Tutorials   Links   About Us

Back   Index   Next  


10. Texture Mapping (a different way)

In this Section:
General
In gMax
In Paint Shop Pro
Back in gMax


General

There are several good tutorials out there on texturing in gMax at places like Free Flight Design Shop and gMax Domination.

Also, while I was writting this Bruce Edge aka "FSEdge" sent me some excellent examples of using multiple materials to texture rounded surfaces. However, this is the Stupid Idiots Guide to gMax, and being "Idiot #1", I haven't figured it out enought to write it down to "my level" yet! Once I get a handle on it I'll add it to this chapter.

I suggest you look at them all. I'm just teaching you one way among many that works, but it might not be the way tht works best for you.

One of my favorites is Finn Newick's excellent video-tutorial at gMax Domination on texture mapping. However, this requires the use of LithUnwrap (now Ultimate Unwrap3D), a pay-ware program. My method, however, requires gMax and a layering paint program (I'll use Paint Shop Pro, but others will work).

In short, here's what we're going to do (I'll explain each in detail below):

  1. In gMax:

    • Understanding Distortion of textures on rounded shapes (Top/Bottom of the fuselage, along the leading edges of the wings, etc.).

    • Adjust the viewports in gMax so they are all the same "scale".

    • Save the file as a template

    • Take screenshots all the Major Objects (fuselage, wings, etc.)

  2. In Paint Shop Pro (or other paint program):

  3. Back in gMax


In gMax

Distorted Textures Understanding Distortion of textures on rounded objects: When a flat texture is "pasted" on a round object like the fuselage it's distorted. Along the side it looks fine, but near the top and bottom there's more area to cover for the same number of pixels, and the texture will look "stretched". I'm not going into a lot detail about this. If you want to know more watch Finn's texture mapping tutorials at gMax Domination. Finn uses the LithUnwrap (now Ultimate Unwrap 3D) to adjust his textures. I'll use a similar method that doesn't require the additional Program, but works much the same way.

CFS3 Bf109g6 textures On thing that will help you decide how to overcome texture distortion is to look at other designer's textures. For instance, here's a screenshot of the stock CFS3 Bf109g6. You can see by the way the texture is of the fuselage looks "stretched" that the designer manipulated the texture map to cover the top and bottom of the fuselage.

NOTE: To View DXT files (*.dds) used for CFS3 textures (as well as to make them) you will need a DXF plugin for PSP, such as the NVIDIA DXT Compression Tools (also search for DXT_TOOLS). This will work in both Photoshop and Paint Shop Pro. You can also use Martin Wright's DXTbmp available at MW Graphics. I use both.

Adjust the viewports in gMax so they are all the same "scale": Here we'll set there of our viewports all to the same view (Top, front, left, etc.). Which view you use depends on your aircraft. You want the longest single textured object to fill the viewport (but not overlap it). For most aircraft (provided you texture each wing separately) this will likely be the fuselage. If that's the case you'll want to use either the Left or Right view.

Set Viewports to the same Scale Take screenshots So, set the three viewports you're using to the same scale. Here, we'll selected each viewport and Press "L" for "Left". Now, click on "Zoom Extents All". Now, all your Viewports are the same scale. You can select each viewport and set the view direction using Shortcut keystrokes ("T"=Top, "B"=Bottom, "L"=Left, "R"=Right, "K"=Back, "F"=Front) without the scale changing.

This is your texture template so Save the file with a different name. Now, Save it again for your working file. You don't want to loose this scale until you're done texturing the major components of your aircraft, so it's good to have one to "go back to" in case you accidentally change the scale in the viewports.

Take screenshots all the Major Objects: By using Hide and Unhide, Select each major component of your aircraft (fuselage, tail, wings, etc.) and center it in the viewport using the Pan button. Use the Min/Max Toggle expand the viewport and take your screenshot. You can do this by pressing Print Screen in gMax (and Paste in Paint Shop Pro) or my using a screenshot utility such as MultiGrab from MW Graphics.

You'll see that for objects that I want to "texture together" (such as the wings/ailerons/flaps) I've had all these parts in the same screenshot. This made it real simple, and I was able to get all my major components in three screenshots.


In Paint Shop Pro
(or other paint program)

Paste as Layers Plan your Texture: Once you have screenshots in Paint Shop Pro (PSP, or whatever paint program you're using) it's time to plan out your texture. For this I'll be using PSP, and will briefly describe the techniques I use (but remember what my old Ranger Instructor once said about "techniques"!).

Remove Selected Color Paste Screenshots: If you're using PSP, paste all your screenshots into the same files as "layers" (Copy the screenshot, then Cntl-L to paste it into the file. Do this will all of them until you have everything in a single PSP file. You need to put your screenshots into a PSP file you you won't be able to "remove" color (below), and it'll be much easier if they're all in a single file.

Layers & Color Replacer Remove Selected Color: Now we want to remove "everything" from each screenshot except for the wireframe of the object we want to texture. In this example we'll use the wing. Using the Dropper we'll select the color of the wing wireframe (in this case "yellow") as the "background color" by Right Clicking on the color. Then hit Cntl-A to "select all" and then Cntl-T to bring up the Remove Selected Color dialog box. Make sure you've selected "Background Color" with a tolerance of "1". Click OK, and everything but the background color (the wireframe of the wing) will be selected. Hit the Delete key, and then repeat this for each layer. If one of the screenshots is also your "background layer" this will not work. Simply "duplicate" (or copy/paste) the background as a layer (in this case I've made the background layer an even gray color).

Canvas Size & Mover Now we need to Duplicate each or the layers to represent the right/left sides of the fuselage and the top/bottom sides of each wing. I've used Color Replacer to recolor each layer. Also add a "dot" with the Airbrush to help when using the "Mover" tool (next step).

Texture Map To increase the area of the file, go to Image/Canvas Size.

Arrange Texture Map: Now using the Mover we'll start moving and adjusting the layers to figure out what the best fit we can make for our texture is. Remember that you will need to leave room for the gear wells, spinners, wheels, and other things, so don't pack everything in too tightly. Also, if you're going to want to adjust for texture distortion (as we talked about above) you'll want to leave room at the leading edges of the wings and the top/bottom of each fuselage half.

Once you have everything arranged to your satisfaction use the Crop tool to trim your Texture Map to an EXACT SQUARE. Then Resize it, making sure the final dimentions are in the Power of 2; 128x128, 256x256, 512x512, or 1024x1024 (in pixels). Save it both as a PSP and a BMP file.

Notes on Naming Textures: Unlike FS2002 (and all previous version of MSFS/CFS)--where the textures were placed in a "sub-folder" to the main aircraft folder--CFS3 looks thru the Entire Sim Folder for names. Because of this, every aircraft must have a unique texture name (or XDP name, or whatever). If your aircraft has the same texture name as another, the sim will "Have a fit".

Generally, I follow the nameing convention of the stock aircraft, and add a _t suffix. Also, if you want your aircraft to have winter textures you will make that a _t_w (you'll also have to modify the *.mos file). Other than that you can name it whatever you want.

EXPERT NOTES! From "Mikoo": That [CFS3] looks anywhere in the CFS3 folders for a texture is fine--as it saves on a multitude of duplicated textures--but does mean that every texture name has to be unique, not only in my set up but with MS and basically the rest of the world. If somebody names a texture by chance the same as mine the sim will have a fit! One of us will have to rename the texture and perhaps remap...


Back in gMax

Select Polys to texture Now that you’re back in gMax it's time to texture the objects. I'll start with the left wing. We'll start by Selecting the Polygons (or faces) that we wish to texture. To do this we'll add a Mesh Select Modifier and use F2 (the "Shade Selected Faces" Toggle) to ensure we get all the polygons we want (and none of the ones we "don't want") selected.

Add UVW Map Once all the correct polys are selected we'll add a UVW Map Modifier to the stack. Ensure you have "Planar" checked and select "X", "Y", or "Z" under "alignment" to orient the UVW map the correct way. Next click Fit and you'll see the "Length" and "Width" number change to reflect the exact size the wing as seen from above.

Determine Map Size Now we'll compare the "Width" number from the UVW map with the width of the wing from our texture map to Determine the size the UVW Map needs to be using a simple formula:

We already have the width of the wing in gMax from our "fitted" UVW Map (3.941m). To get the width of the wing on our texture map we'll open the texture map in Paint Shop Pro and can see in the lower left hand corner it is 1024x104 pixels in width. Using the Crop tool to "outline" the wing and watching the lower right corner we see the width of the wing is 487 pixels. Now we'll plug the information into our formula:

Now we'll go back to gMax and change both the length and width of our UVW map to "8.29" meters after rounding. Remember, the sim will only recognize square textures, so the UVW map must be square.

NOTE: If you change the numbers to reflect a square UVW map (say, 10m x 10m) but it doesn't look square (or the "numbers don't add up") it may be because you've applied a scale to the whole object (not in the "Sub-object mode"). First, try going to the Herarchy Tab and hitting the Reset/Scale button. If that doesn't work, here's ha way to fix it (there may be other--easier--ways. If so let me know!): Create a new box, convert it to Editable Poly (I'm sure edit mesh--etc.--would work). Then delete all the polygons (but leave the vertices. Now Attach the "problem part" to the new box, and click on "Removed Isolated Vertices" (the ones from the box). The problem (I say with "fingers crossed") should be solved!

Add a Material Add a Material Once you've changed the size of the UVW Map let's Add a Material to the wing and see what it looks like. To do this we'll click on the gMax Material Editor. Once the dialog is open look under Blinn Basic Parameters and click on the little square button to the right of Diffuse. If this is the first material you've applied to this object it'll open the gMax Material Navigator (normally this is opened by the button with three colored spheres, on the tool bar and in the gMax Material Editor). If you've already applied a material to the object, then instead a new option will open within the gMax Material Editor (see screenshots). In both cases, click on "bitmap" and navigate your way to your texture map (mine is Me_334_t). Select it, click "OK", and then in the gMax Material Editor name your material (mine is Exterior) and click on Apply. Be sure the Show Map in Viewport button (a small box with blue & white checkers) is enabled. Close the Editor.

Positioning the texture Map Positioning the texture Map: We should now see part of our texture map on the top half of the wing. To position this correctly, we'll Toggle Edged Faces (F4 Key), then use the Select and Move button on the UVW Mapping Gizmo to move the map into position. If you need to, you can use Select and Rotate (or just type the rotation angle in to the coordinate display at the bottom of the screen) to rotate the texture map to fit the object. If you've done everything right, the wireframe outline on the texture map should line up with the Edged Faces on the object.

Now, Repeate for the Underside of the Wing. To do this add a Mesh Select Modifier, use Edit/Select Invert to reverse the polygons that are selected, then add a UVW Map Modifier. Remember to resize the UVW Map and orient it correctly.

Texture Distortion If you're happy with the texture, you're done. However, once we get both maps added to the wing we can see some texture distortion along the leading edge just like the one that Finn points out in his tutorial. Therefore we're going to use Unwrap UVW to fix it.

Unwrap UVW & Edit UVWs Dialog Go back and add a Unwrap UVW Modifier in the stack above each UVW Map Modifier. For each, click on Edit to bring up the Edit UVWs Dialog. The section on the Edit UVWs Dialog in the gMax Help file is quite comprehensive, so I'll only touch on the sections we'll use here. However, I suggest you read the gMax help file section, as there's a lot you can do with this.

Move Vertices in UVWs Dialog When we zoom in on our wing in the Edit UVWs Dialog we see that we can select/Move each Vertex. Better yet, you can move the Edit UVWs Dialog over to the side of the screen and see how the texture map on your object is effect as you adjust Vertices in the Edit UVWs Dialog. In this case, we'll Hold down the "Control" key while we select the vertices along the leading edge of the wing. Then we'll use the Move tool to adjust them forward a bit. You won't need my on the leading edge of the wing.

Fuselage Texture Distortion However, for something as large and "round" as the Fuselage you'll need a little bit more. Again, we can get an idea how "much" we'll need to stretch my looking at the Stock CFS3 Bf109. You see that the MS designer use a lot of "stretch" on their textures, and we probably should too. You can also see the amount of "Texture Distortion" we have on the fuselage.

To make this easier on ourselves, we'll Texture half of the fuselage, then Clone and Mirror it.

So, go ahead and add a UVW Map modifier, Size it, and position the texture map. Once that is done, go ahead and add a Unwrap UVW Modifier to the fuselage and open the Edit UVWs Dialog just like we did for the wing. Also like the wing, we'll use the Edit UVWs Dialog to Move the vertices along the top "up" and the ones along the bottom "down". Unlike the "single row" we moved on the wing, however, we'll use some “additional tools” for the fuselage.

Edit UVWs Dialog-Falloff If you look at the screenshot of the Edit UVWs Dialog-Falloff you'll see I've used Falloff to effect the movement of the vertices on the fuselage. This works similar to Vertex/Soft Selection in Edit Mesh or Edit Poly. I don't have any "hard" and "fast" rules on how do this. You'll have to play with it yourself to see what works best for you. Also try using the Expand/Contract Selection button to adjust which vertices to move. Again, take some time and read through the gMax Help File section on the Edit UVWs Dialog.

Edit UVWs Dialog-Both Halves Once you have your half of the fuselage looking like you want, you can Edit/Clone and Mirror it, just as we did in Chapter 8. Then on the "new" fuselage half you've want to edit the Edit UVWs Dialog one last time. This time Select all the vertices and use Rotate, Move, Mirror, or Flip to position it correctly on your Texture Map.

Final Fuselage Finally, you can take a screenshot of your Edit UVWs Dialog, resize it in PSP, and use this as a new Texture Map guide when you paint your textures. You can also use LithUnwrap (now Ultimate Unwrap3D). Hopefully the next version of gMax (I'm using 1.2 right now) will have this capability.

Joining the Fuselage halves together is covered in Chapter 8.

Using the Unwrap UVW and the Edit UVWs Dialog take some time and care, but if you compare this screenshot of the final fuselage with the one above showing the Texture Distortion I think you'll agree that it was well worth the effort.

That's it. Everything else on the aircraft is textured the same way. For the wing control surfaces I used the same coordiantes I used on the UVW Map modifier for the wing (I didn't use a Unwrap UVW) modifier. Something that may help you when lining up two objects that share the same texture (flaps to the wing, tail to the fuselage, etc.) is to paint "hash marks" on the bitmap where these object overlap. Line up the hash marks, and the texture is aligned.

Again, please let me know what more you need help on. I'll keep working on this tutorial, but I want to get what I've got posted for you. I figure it'll do more good for the community out there--incomplete--that it'll do sitting on my hard drive!

~Hugh Shoults
09 Feb 03


Back   Index   Next  

Home   CFS 1   CFS 2   CFS 3   Tutorials   Links   About Us

Simviation.com