Solved Making a vehicle separate colours with colour selector (without using skins)

Discussion in 'Mod Support' started by AgentMooshroom5, Sep 1, 2018.

  1. AgentMooshroom5

    AgentMooshroom5
    Expand Collapse

    Joined:
    Oct 29, 2017
    Messages:
    1,078
    The title may sound confusing, but bear with me here.
    I want to make it so a vehicle has a 3-tone colour design using the 3 different colour selectors to set those colours
    colours1.png
    I can't figure out how to do this using only materials which is what I need, as the model I want to use this for is too complex for UV mapping and I don't know anything about stuff like that.
    I've created 3 copies of the main body material from the bolide and put it on a test vehicle, but the colours of them all seem to be linked to the first one and I can't figure out what part of the materials decides this. I've tried changing various values inside the materials file but nothing changes
    I've left the materials in question and the est vehicle attached so anyone can take a look at it and attempt to help or something (you can ignore the carbon part, that's just left over from something else. The vehicle itself is just the idealcar with the blender cube as the body)
    Code:
    singleton Material(body)
    {
        mapTo = "body";
        diffuseMap[2] = "vehicles/amtest/body_c.dds";
        specularMap[2] = "vehicles/amtest/body_s.dds";
        normalMap[2] = "vehicles/amtest/body_n.dds";
        diffuseMap[1] = "vehicles/amtest/body_d.dds";
        specularMap[1] = "vehicles/amtest/body_s.dds";
        normalMap[1] = "vehicles/amtest/body_n.dds";
        diffuseMap[0] = "vehicles/common/null.dds";
        specularMap[0] = "vehicles/common/null.dds";
        normalMap[0] = "vehicles/amtest/body_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";
    };
    
    singleton Material(body2)
    {
        mapTo = "body2";
        diffuseMap[2] = "vehicles/amtest/body_c.dds";
        specularMap[2] = "vehicles/amtest/body_s.dds";
        normalMap[2] = "vehicles/amtest/body_n.dds";
        diffuseMap[1] = "vehicles/amtest/body_d.dds";
        specularMap[1] = "vehicles/amtest/body_s.dds";
        normalMap[1] = "vehicles/amtest/body_n.dds";
        diffuseMap[0] = "vehicles/common/null.dds";
        specularMap[0] = "vehicles/common/null.dds";
        normalMap[0] = "vehicles/amtest/body_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";
    };
    
    singleton Material(body3)
    {
        mapTo = "body3";
        diffuseMap[2] = "vehicles/amtest/body_c.dds";
        specularMap[2] = "vehicles/amtest/body_s.dds";
        normalMap[2] = "vehicles/amtest/body_n.dds";
        diffuseMap[1] = "vehicles/amtest/body_d.dds";
        specularMap[1] = "vehicles/amtest/body_s.dds";
        normalMap[1] = "vehicles/amtest/body_n.dds";
        diffuseMap[0] = "vehicles/common/null.dds";
        specularMap[0] = "vehicles/common/null.dds";
        normalMap[0] = "vehicles/amtest/body_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";
    };
     

    Attached Files:

  2. Ai'Torror

    Ai'Torror
    Expand Collapse
    BeamNG Team

    Joined:
    Aug 29, 2015
    Messages:
    1,546
    Burnside Special has a 2 tone paint job from standard. I'd suggest you to use it as your testing mule or just reverse engineer it.
     
  3. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,681
    You'd need to take a advantage of the skin system:

    Use a colorpalette:
    colorPaletteMap[0] = "vehicles/common/nullcolormask.dds";
    You'll notice that texture is blue. Blue is the third color wheel.
    Make your own texture that has R G B colored according to the parts you want to color.

    Parts like 'rollcages' and some 'wheels' do use this system.
     
  4. AgentMooshroom5

    AgentMooshroom5
    Expand Collapse

    Joined:
    Oct 29, 2017
    Messages:
    1,078
    Thanks so much, it worked!
    colours2.png
     
  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