3ds Max: Texture Mapping Borders

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search


Tools used in this tutorial

Required



-=Download Max Scenes=- for this tutorial.

It's a 7-zip archive. 7-zip is a freeware zip program which can be downloaded from 7-zip.org. It can achieve superior compression compared to any other zip program out there.



Image1

1. Draw out a plane with a length of 32 and a width of 256. The length and width segments doesn't matter, so you can leave both of them at 1. When you're done, select your mesh and position it at 0,0,0 in the universe, by simply inputting those numbers in the XYZ numerical boxes near the bottom of your screen.



Image2

2. Click in the top viewport, or press the T key on your keyboard. Then click the little icon to the extreme lower right that looks like two squares with an arrow ("A"). If you hover your mouse over it and it says "Maximize Viewport Toggle" then that's the one. Now you have a full view of your model from the top.


Open the material editor by pressing the M key on your keyboard. Pick an empty material ("B"), and set the ambient color ("C") to 200 ("D").


The higher the number, the brighter your texture can look through dynamic lighting, the lower the number the darker it will look. You can see it as a cap on how bright your model can possibly look in-game. If you set it to 255 for instance it will result in extreme glare. To some degree it's a matter of taste, but I find 200 to be a good value.



Image3

3. Open the Maps parameter rollout in your material and set up the example texture from the reference folder, "Qgoldtrim1.dds", in the diffuse slot. Leave all the other options at their default. Drag and drop your material onto the plane. And of course make sure the icon "Show map in Viewport" is pressed (noted as "A").


(The texture used in this tutorial is from the Morrowind retexture pack "Vibrant Morrowind", created by skydye and headlesswonder. It used to be called "Qgold_trim1.tga", but I converted it to DDS and renamed it so it work with Oblivion nifs for this tutorial.)



Image4

4. Click the Bitmap path button ("A") and the Select Bitmap Image File dialogue window opens again. This time, notice how it reports the statistics of the texture file, almost near the bottom of the window? It tells us that the texture is 1024 pixels in length and 256 pixels in height. We're going to need these numbers to calculate the mapping on the planar model we created.



If you open up "TextureMappingBorders_tutorialscene1.max" you'll see the result of the steps covered in #1-#4.




Image5a

5. So, now we know that the texture is 1024x256 *pixels* and that the border we want to map is 256x32 *points*. In other words the texture has an aspect ratio of 4:1 and the border has an aspect ratio of 8:1. You can get to those numbers by simply dividing the highest number with the lowest. It doesn't tell us much, but the numbers alone indicates that the surface is twice as long as the texture.

Add an Uvw Mapping modifier to your model. It should automatically start out as a planar map, but if it isn't, ensure that it is and leave the other options at default. Note how the Parameters rollout reports the Length and Width of the mapping? It should default to 32,032 and 256,256 and cover your planar model perfectly. (You usually don't notice it, but Max automatically sets up the mapping when you create primitives, which is why this works automatically on a planar mesh)

Right, time to fire up your Windows calculator! First divide the highest number of the mapping with the lowest. In this case, 256,256/32,032, which equals 8. The next step is crucial. Divide the aspect ratio of the texture file with the result of the previous calculation. The aspect ratio in this example was 4, so: 256,256/32,032/4 = 2.

This tells you that you need to tile the texture 2,0 times on the "long side" of it to get a perfect aspect ratio, as seen in the image below.

Image5b



Image6

6. And that's all there is to it. Sounds simplistic and stupid maybe, but that's because I conciously chose easy numbers for this tutorial. With these numbers I would have figured out it needed to tile twice before I started. However as a modeller you'll rarely have the luxury of simple numbers, so just for fun - and to underline exactly why the calculations are so important - lets whip up a second planar mesh. Let's make it... say... 31,187 points in Length and 302,312 points in Width and repeat the steps above so it'll look like in the image above.



Image7

7. 302,312/31,187/4 = 2,4233815371... etc. Max can only record so many numbers, so only the four decimals matter, and even then you'd have to look at it microscopically to notice any difference beyond the first two decimals. Let's round it off to 2,424. And there you have it - this is the method to get perfect border textures every time.



If you open up "TextureMappingBorders_tutorialscene2.max" you'll see the result of the steps covered in #1-#7.



I've also included a third tutorial scene showing several different aspect ratios in use, as well as exported nif file in case you have a use for it. Feel free to use the nif file in any way you want, as long as you credit Vibrant Morrowind for the textures (if you use the included ones). You can reskin it with any textures that have the same aspect ratios, but if you use textures with different aspects then naturally it'll look bad.


Credits: Vibrant Morrowind, for textures (Qgoldtrim1 and Qgold01.dds) Gundalf, for creating the 3D Studio Max exporter




I hope this tutorial was informative to you. If you would like to read more of my tutorials, please see the Tutorial Board on Silgrad Tower's Forum. You are welcome to repost this tutorial anywhere you like as long as it's apparant I (Razorwing) wrote it. Please include a link to Silgrad Tower too. If you would like to contact me, my ESF username is Gloomwing.