Released TUTORIAL: Adding textures and materials without UVs

Discussion in 'Content Creation' started by RedBolide, Apr 28, 2014.

  1. RedBolide

    RedBolide
    Expand Collapse

    Joined:
    Apr 22, 2013
    Messages:
    362
    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.
    1.jpg

    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.
    2.jpg

    For this demonstration, I'll be texturing the left door of the model. Texturing the other parts works the exact same.
    3.jpg

    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.
    4.jpg

    Here is the door without any textures. I'll go step by step to show you the process of texturing a mesh.
    5.jpg

    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.
    6.jpg

    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.
    7.jpg

    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.
    8.jpg

    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."
    9.jpg

    Same process for the rest of the textures.
    10.jpg
    12.jpg

    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."
    12-5.jpg

    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."
    13.jpg


    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.
    14.jpg

    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.
    15.jpg

    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.
    16.jpg

    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.
    17.jpg

    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.
    18.jpg

    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_..."
    19.jpg

    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."
    20.jpg

    Copy and paste these textures into a new folder.
    21.jpg

    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_..."
    22.jpg


    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.
    23.jpg

    I now have all 3 texture maps in a .PNG format. Now, I can edit the files.
    24.jpg

    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.
    25.jpg

    With part of the hood copied, I erase the rest of the map.
    26.jpg

    Now I paste that part of the hood...
    27.jpg

    ...enter transform mode...
    28.jpg

    ...and enlarge the square to fill up the entire map. Now, all of the map with be painted.
    29.jpg

    I now repeat the process for the other two texture maps.
    30.jpg

    Copy and paste part of the hood, erase the rest, and transform it to fill the map.
    31.jpg

    Two down, one to go.
    32.jpg

    Same process.
    33.jpg

    Copy, erase, paste, transform.
    34.jpg

    Done with all three.
    35.jpg

    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.
    36.jpg


    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.
    37.jpg

    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.
    38.jpg

    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.
    39.jpg

    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."
    40.jpg

    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.
    41.jpg

    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.
    42.jpg
    I've pasted the material over Paint3. Now, Paint3 will have proper materials.
    43.jpg

    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.
    44.jpg

    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.
    screenshot_00007.png

    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."
    screenshot_00008.png

    While inside the material, go to layer 2.
    screenshot_00009.png

    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.
    screenshot_00010.png

    Repeat the process for the other materials. For Paint2, I'm going to choose red.
    screenshot_00011.png

    Paint3 is a light grey color.
    screenshot_00012.png

    For the chrome parts, choose a lighter grey color.
    screenshot_00013.png

    Paint4 is the same as Paint3.
    screenshot_00014.png

    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.
    screenshot_00015.jpg

    This is my favorite color setup. It's based on the original colors for the Blazer.
    screenshot_00016.jpg

    Here's a custom one.
    screenshot_00017.jpg


    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
     
    #1 RedBolide, Apr 28, 2014
    Last edited: May 27, 2014
    • Like Like x 1
    • Informative Informative x 1
  2. Autofan

    Autofan
    Expand Collapse

    Joined:
    Jun 26, 2013
    Messages:
    470
    Thanks for the tutorial :D this is very helpful.

    Also I'm loving that Blazer. Do you plan on releasing it?
     
  3. Maj_Turbolag

    Maj_Turbolag
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    86
    This could be useful later on. Looking forward to the finished Tutorial.
     
  4. Leet34

    Leet34
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    225
    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:

    3ds-Max-Chrome-Material-Tutorial.jpg
     
  5. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,683
  6. Brett

    Brett
    Expand Collapse

    Joined:
    Jul 27, 2013
    Messages:
    300
    Very cool, I'm gonna need this for my Toyota.
     
  7. RedBolide

    RedBolide
    Expand Collapse

    Joined:
    Apr 22, 2013
    Messages:
    362
    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.
     
  8. Leet34

    Leet34
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    225
    Great.
     
  9. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,616
    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!

    Capture.JPG

    I hope you don't mind but I will post a tutorial video of this soon :)
     
    #9 ThreeDTech21, May 18, 2014
    Last edited: May 18, 2014
  10. RedBolide

    RedBolide
    Expand Collapse

    Joined:
    Apr 22, 2013
    Messages:
    362
    Finally got around to finishing the tutorial. Hope it helps!
     
  11. DrowsySam

    DrowsySam
    Expand Collapse

    Joined:
    Jul 30, 2013
    Messages:
    996
    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.
     
    • Like Like x 1
  12. RedBolide

    RedBolide
    Expand Collapse

    Joined:
    Apr 22, 2013
    Messages:
    362
    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. :p I didn't realize you could do that. Thanks for pointing that out!
     
  13. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,616
    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
     
    • Like Like x 1
  14. umustbeloggedintododat

    umustbeloggedintododat
    Expand Collapse

    Joined:
    Feb 16, 2019
    Messages:
    1,381
    the textures part is really really hard :( (really sorry for the bump)
     
  15. Alex_Farmer557

    Alex_Farmer557
    Expand Collapse

    Joined:
    Dec 28, 2016
    Messages:
    3,541
    A 3 year bump that doesn't contribute. Great.
     
  16. umustbeloggedintododat

    umustbeloggedintododat
    Expand Collapse

    Joined:
    Feb 16, 2019
    Messages:
    1,381
    i sad really sorry for the bump.
     
  17. Alex_Farmer557

    Alex_Farmer557
    Expand Collapse

    Joined:
    Dec 28, 2016
    Messages:
    3,541
    My post doesnt contribute either lol
    Let's leave this thread to die
     
    • Agree Agree x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice