This is a step-by-step tutorial for adding materials and textures to a model for BeamNG without using UV maps. UV maps are, by far, the best way to texture a model. At the same time, they take a long time to effectively create. This method is great for adding simple textures and materials that look good, but don't take as much time or skill to create. Special thanks to SLS ST for letting me use his K5 Blazer model for this tutorial. CHAPTER 1: TERMINOLOGY AND SOFTWARE Before we dive into materials and textures, it might help to understand a few key terms. These might not be the proper (or correct) definitions. This is how I define these terms based on my experience. -Texture: adds color to a model -Material: determines how and where textures are applied on a model -Material File: specifically called "materials.cs," this file can be found in most vehicle files; it lists all of the materials for a particular model. -DDS/PNG: these are two file extensions commonly used for textures; DDS files can't be opened in most programs, but they can be easily be converted to PNG files, allowing them to be opened in almost all programs Required Software: BeamNG Drive Blender (I use 2.63) Notepad Program for viewing/converting dds files (I strongly recommend using XnView for this) CHAPTER 2: TEXTURES First, we need to make the textures for our model. Below is an image of my textured model without any materials. By the end of this chapter, your model should look something like this. When the model is opened in BeamNG, the materials.cs file will automatically add basic materials to show the textures on the model. However, these materials don't have any reflections or shadows. This will be fixed later. First, open your model in Blender. Here is the model I'll be using for this tutorial. This is the fully-textured model. It takes about an hour to fully texture the model. For this demonstration, I'll be texturing the left door of the model. Texturing the other parts works the exact same. Before we start, figure out what colors you will need for the mesh. For now, I need 3 different paint colors (light grey on the bottom, red in the middle, dark grey on top), a chrome color for the door handle, and a black plastic color for the area around the windows. Here is the door without any textures. I'll go step by step to show you the process of texturing a mesh. I'll start by adding the texture for the first paint color, which is light grey. Start by going into edit mode in Blender and selecting all of the faces for paint color 1. Next, toward the right of the screen, click on the "Material" window. In the window, you will see a number of different empty slots. Pick one and click the "New" button. Now I can add color and a name to this texture. The name of the texture can be typed in the small box under the "Assign" button. The color can be changed in the diffuse box. I selected a light grey color for this first texture. Once you have the color and name you want, click the "Assign" button. Repeat this process for the remaining colors you need. Paint color 2 is red. I selected all of the faces for the second paint color, chose a red color in the diffuse box, changed the name to "PaintColor2," and clicked "Assign." Same process for the rest of the textures. Once you've created a material for a part, you can use it again on other parts. Instead of clicking the "New" button, click the small sphere right next to it. From there, you can browse the materials you've already created. For this part, I want to use the chrome texture I used for the door handle. I just clicked the sphere and selected "chrome." Some parts require less effort to texture, like the front bumper. The entire part needs to be chrome, so I just selected all of the faces, chose my chrome texture, and clicked "Assign." CHAPTER 3: SETTING UP MATERIALS Now that we have our textures done, it's time to set up the materials. This will add reflections and shadows to the textures. It also allows the color to be changed through the in-game material editor. Start by opening the materials.cs file of your vehicle. Once inside, find the textures you added in Blender. I want to change the materials on the paint colors and chrome, so I scrolled down and found them. The easiest way to add materials is to use existing ones. I've already used the materials from the D15 and Covet in past mods, so I decided to use the materials from the Grand Marshall. Remember to GIVE CREDIT if you use other people's stuff though! Start by going into the vehicle file and opening up the materials.cs file. I want to find the paint part of the material file. In this case, it is the material called "fullsize." I've highlighted it below. Copy all of the material except for the lines relating to "singleton Material" and "mapTo." These lines were automatically added when we opened the mesh in BeamNG, as you can see in the materials.cs file of the Blazer on the left. Now paste the new materials over the old ones, leaving the "singleton Material" and "mapTo" lines unchanged. Double check that you didn't omit any brackets or semicolons. We don't need all of the stuff we copied over. Start by removing all of the lines that are commented out. These lines have a "//" in front of them. They don't actually do anything. They are just comments. Also, we can delete any lines relating to the normal maps, since our materials won't be dealing with them. If you run the car in-game with these materials, you will either get a material editor or see the UV maps of the Grand Marshall. Either way, it doesn't look right. This is because the materials we used are still linked to the textures from the Grand Marshall. As you can see below, the materials we copied are called "fullsize_..." Start by going into the folder of the fullsize and moving all textures into a new folder. In this case, I need "fullsize_c_alt.dds," "fullsize_d.dds," and "fullsize_s.dds." Copy and paste these textures into a new folder. Next up, let's rename the files. Since the car I'm making is a Chevy Blazer, I decided to name all of the files "Blazer_..." CHAPTER 4: EDITING MAPS FOR MATERIALS [OPTIONAL*] At this point, you should have 3 main texture maps for your model. Right now, I have "Blazer_c.dds," "Blazer_d.dds," and "Blazer_s.dds." Remember though: those three files are just the Grand Marshall texture maps with a different name. If we want those maps to work on our model, we'll have to do some editing. This chapter isn't required since most people probably don't have access to CS6E. I will attach some maps for y'all to use so you don't have to make them yourself. You can download them at the end of the tutorial. However, I strongly recommend reading through it. This is the process of making the map. If you don't want to make the texture maps yourself, you can skip this chapter and download the attached files instead. First, I'm going to open my 3 files in XnView. As you can see, they are just the Grand Marshall textures with a different name. The first thing I need to do is convert the textures to .PNG format so I can edit them. Make sure you save the file as a .PNG and not a .JPG. I now have all 3 texture maps in a .PNG format. Now, I can edit the files. I now have the 3 files open in Photoshop. Basically, these maps show what color is added where on the Grand Marshall. However, since we already defined the locations of each material in Blender (by assigning certain parts of the mesh to different materials, like Paint 1 and Paint 2), we don't need to use texture maps. I want the paint to cover the entire map. Right now, only specific parts of the map are paint (the body panels). First, I select part of the hood. The hood is a good place to work from, since the texture is smooth and single-colored. It doesn't have any shadows or other colors like some of the other parts. With part of the hood copied, I erase the rest of the map. Now I paste that part of the hood... ...enter transform mode... ...and enlarge the square to fill up the entire map. Now, all of the map with be painted. I now repeat the process for the other two texture maps. Copy and paste part of the hood, erase the rest, and transform it to fill the map. Two down, one to go. Same process. Copy, erase, paste, transform. Done with all three. Now that I've edited the three .PNG textures, I'm going to open them into XnView and convert them back to .DDS format. Just click "Save As..." and replace the old texture maps. CHAPTER 5: FINISHING THE MATERIALS Now that I have my texture maps, it's time to finish up the materials. First, move the new texture maps into the vehicle folder. Scroll back down to the materials we added earlier for the paint. As you might notice, the materials use the files from the Grand Marshall. Since we've changed the files, we need to update the materials. This line says "vehicles/fullsize/fullsize_c_alt.dds." This material tells the game to apply the texture "fullsize_c_alt.dds" to the mesh. The file is located in vehicles/fullsize. Let's update this. First of all, the textures are now located in a different file. In my case, the vehicle folder I'm working with is called "80Blazer." I replaced "vehicles/fullsize/" with "vehicles/80Blazer." Next, we need to change the names of the files. The first file is called "fullsize_c_alt.dds." I edited this texture and changed the name to "Blazer_c.dds," so I need to change the name. I changed the name for all 3 texture maps, so I need to fix the materials with the new names. We now have one complete material! However, this material only covers "Paint1." I still have 3 more paint colors and chrome that need materials. To do this, simply copy and paste all of the material except for the lines starting with "singleton Material" and "mapTo." Make sure not to accidentally delete any ] or ; while doing this. I've pasted the material over Paint3. Now, Paint3 will have proper materials. For some parts, you might want to add the line " doubleSided = "1"; " to make the material appear on both sides of the mesh. However, this might reduce your fps when using the mod in the game. Only use it if you have to. It's finally time to launch the mod in-game to tweak the materials. Go into BeamNG and spawn your vehicle. If you've done everything correctly, all of the materials we added should appear white and reflective. Next, press F11 to launch the in-game editor. Press F4 to get into the material editor. Select your vehicle and look for the materials you added. I'm going to start by editing "Paint1." While inside the material, go to layer 2. Click the small box labeled "color" in the "Diffuse Map" section. This will open a color selector. From here, you can choose whatever color you want. I'm going to add the same colors as the original model, so the first color I need is black. After editing the material, make sure to press the save icon before moving on to the next material. Repeat the process for the other materials. For Paint2, I'm going to choose red. Paint3 is a light grey color. For the chrome parts, choose a lighter grey color. Paint4 is the same as Paint3. That's it! The materials are finally done. Now, the colors of the car can be changed through the in-game material editor. These are the original colors from the model. This is my favorite color setup. It's based on the original colors for the Blazer. Here's a custom one. CONCLUSION I hope this tutorial was helpful. Remember, this isn't necessarily the best way to do textures and materials. UV maps are always a better option. If you're having and problems, please post them in the comments below. I'll do my best to help. Below is the link to the pre-made textures. If you plan on using them, please give me credit. Thanks for reading my tutorial! https://www.dropbox.com/s/u96ub6ytakvhc2b/Textures.zip
Thanks for the tutorial this is very helpful. Also I'm loving that Blazer. Do you plan on releasing it?
Pretty useful, this is the tutorial you promised me. Anyway I work in 3ds Max, not a big deal, i can set materials in blender, but i was especially asking if there is a way to create decent (and maybe realistic) chrome material AND if T3d will handle it. Example:
Faking chrome with cubemaps. http://www.beamng.com/threads/7660-Advanced-Materials?p=102221#post102221
Yes. This is ony the first part of the tutorial. I haven't covered materials yet. I've already typed up more, but I haven't posted it yet.
How are you adding multiple colors in edit mode? when i use edit mode and select a number of faces it still assigns the material to the whole object, not just the portion that is selected, I also tested this in version 2.63.. - - - Updated - - - Thankyou for this tutorial! my car is now getting there! I hope you don't mind but I will post a tutorial video of this soon
This is probably the worst way I can think of to do it.. Use the null textures instead, that way you don't have to touch UV's inside Blender, or use existing vehicle textures. (Which causes texture errors sometimes). Take my Swift DS95 Glider for example Swift-DS95-V2-Released Code: singleton Material(glider_body) { mapTo = "glider_body"; diffuseMap[0] = "vehicles/common/null.dds"; specularMap[0] = "vehicles/common/null.dds"; diffuseMap[1] = "vehicles/common/null.dds"; specularMap[1] = "vehicles/common/null.dds"; diffuseColor[0] = "1 1 1 1"; diffuseColor[1] = "0.5 0.5 0.5 0.7"; specularPower[0] = "16"; specularPower[1] = "16"; useAnisotropic[0] = "1"; useAnisotropic[1] = "1"; castShadows = "1"; translucent = "1"; translucentBlendOp = "None"; alphaTest = "1"; alphaRef = "0"; cubemap = "BNG_Sky_02_cubemap"; materialTag0 = "beamng"; materialTag1 = "vehicle"; }; Basically it links to a completely blank DDS file, so you don't have to alter ANY UV maps, it'll have reflections and pretty colours there for you, just edit diffuse 1, leave the 0.7 how it is.
Wow. I wish someone had taught me that back when I was building the Golf. That would've shaved about a month off my release time. I didn't realize you could do that. Thanks for pointing that out!
I also found a faster way, in the diffuse color section just type the color codes from blender into that section. With that method you completely copy the whole material attribute section from any car, remove the .dds files from your car folder so that the UV maps make a blank map by default, takes about oh 40sec I'll try to post a video soon Sent from my iPhone using Tapatalk