Unsolved How does beamng know where textures go on a model?

Discussion in 'Mod Support' started by Justaparps, Aug 14, 2017.

  1. Justaparps

    Justaparps
    Expand Collapse

    Joined:
    Jul 7, 2014
    Messages:
    124
    I peeked inside material.cs and it seems the file assigns diffusal, normal and specular maps to a part based on the material the part of the model has?

    then i peeked at UV maps inside the file(i randomly chose Maluch mod files inside the .zip file to look at) and now i am confused again....




    Lets say i want to add a texture to a car front bumper, how do i do it? I separate the bumper from rest of the model in blender(3d moddeling software). Do i leave it inside the model whit all other car parts or do i copy paste it to be a separate individual model?

    After i uvmap it and start exporting the model as a .dae for beamng, what do i have to do? Do i export individual parts or the whole model and everything the model has as a singular .dae file?

    If i have exported it based on what you said, how do i start adding textures to the model?

    What do i need to do to make beamng able to assign textures to right model parts in right locations???













    Based on what i learned:

    Some line

    {

    mapTo = "maluch_body_paint.skin.classic"; maps all the info below to this thingy?

    diffuseMap[2] = "vehicles/maluch/common/lakier_c.dds";Bunch of different named maps, why?????
    specularMap[2] = "vehicles/maluch/common/lakier_s.dds"; Why are here 3 types of each map???
    normalMap[2] = "vehicles/maluch/common/lakier_n.dds";
    diffuseMap[1] = "vehicles/maluch/common/lakier_d.dds";
    specularMap[1] = "vehicles/maluch/common/lakier_s.dds";
    normalMap[1] = "vehicles/maluch/common/lakier_n.dds";
    diffuseMap[0] = "vehicles/common/null.dds";
    specularMap[0] = "vehicles/common/null.dds";
    normalMap[0] = "vehicles/maluch/common/lakier_n.dds";



    specularPower[0] = "128"; Bunch of data about the image for beamng to use, eg specularity.
    pixelSpecular[0] = "1";
    specularPower[1] = "32";
    pixelSpecular[1] = "1";
    specularPower[2] = "128";
    pixelSpecular[2] = "1";
    diffuseColor[0] = "1 1 1 1";
    diffuseColor[1] = "1 1 1 1";
    diffuseColor[2] = "1 1 1 1";
    useAnisotropic[0] = "1";
    useAnisotropic[1] = "1";
    useAnisotropic[2] = "1";
    castShadows = "1";
    translucent = "1";
    translucentBlendOp = "None";
    alphaTest = "0";
    alphaRef = "0";
    dynamicCubemap = true;




    materialTag0 = "beamng"; materialTag1 = "vehicle"; What does this do?????


    Full code below:

    Code:
    singleton Material("maluch_body_paint.skin.classic")
    {
        mapTo = "maluch_body_paint.skin.classic";
        diffuseMap[2] = "vehicles/maluch/common/lakier_c.dds";
        specularMap[2] = "vehicles/maluch/common/lakier_s.dds";
        normalMap[2] = "vehicles/maluch/common/lakier_n.dds";
        diffuseMap[1] = "vehicles/maluch/common/lakier_d.dds";
        specularMap[1] = "vehicles/maluch/common/lakier_s.dds";
        normalMap[1] = "vehicles/maluch/common/lakier_n.dds";
        diffuseMap[0] = "vehicles/common/null.dds";
        specularMap[0] = "vehicles/common/null.dds";
        normalMap[0] = "vehicles/maluch/common/lakier_n.dds";  
        specularPower[0] = "128";
        pixelSpecular[0] = "1";
        specularPower[1] = "32";
        pixelSpecular[1] = "1";
        specularPower[2] = "128";
        pixelSpecular[2] = "1";
        diffuseColor[0] = "1 1 1 1";
        diffuseColor[1] = "1 1 1 1";
        diffuseColor[2] = "1 1 1 1";
        useAnisotropic[0] = "1";
        useAnisotropic[1] = "1";
        useAnisotropic[2] = "1";
        castShadows = "1";
        translucent = "1";
        translucentBlendOp = "None";
        alphaTest = "0";
        alphaRef = "0";
        dynamicCubemap = true;
        instanceDiffuse[2] = true;
        materialTag0 = "beamng"; materialTag1 = "vehicle";
    };
     
    #1 Justaparps, Aug 14, 2017
    Last edited: Aug 14, 2017
  2. EcoNadder77

    EcoNadder77
    Expand Collapse

    Joined:
    May 29, 2017
    Messages:
    1,150
    "singleton Material(name)" is the name of the material. The material is then defined (color, reflectivness, etc...) by the rest of the text within the {brackets};

    It doesn't matter if all the parts are contained within one .dae file or split up. Typically, I find it easier to keep everything contained within one .dae file.

    In order to assign a material to an object you must do the following:
    1. Click on the object
    2. Navigate to the materials tab within Blender, and click the new material button. (It will be next to the "3" in the pic below)
    3. Change the name of the material to match the one defined within "singleton Material(NAME)"
    material.png

    This is how BeamNG knows which objects to assign each material to. The name of the material within Blender needs to match the name within the materials.cs file.

    I hope this helps!
     
    • Informative Informative x 2
    • Like Like x 1
  3. Justaparps

    Justaparps
    Expand Collapse

    Joined:
    Jul 7, 2014
    Messages:
    124




    Beamng forums need a option like reddit gold so i can show you the appreciation i have to give you for being so informative and easy to understand! :D
     
  4. Justaparps

    Justaparps
    Expand Collapse

    Joined:
    Jul 7, 2014
    Messages:
    124

    Also, if i want to add two or more colors to my cars to choose in beamng(trough the multiple color chooser under vehicle customization) what do i have to do? Literally on blender choose 2 or 3 different materials on the mesh for 3 different colors i could choose in beamng?
    Eg have body one color and have a possibility to have roof in other color whitout custom texture?


    Like i only have to do body panels in one material and roof on the second material? And then add the 2 materials on beamng files to be color selectable, right?
     
  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