Unsolved 3rd UV Map for AO possible?

Discussion in 'Mod Support' started by NinetyNine!, Apr 4, 2018.

  1. NinetyNine!

    NinetyNine!
    Expand Collapse
    Vehicle Artist
    BeamNG Team

    Joined:
    Feb 17, 2016
    Messages:
    1,343
    Hi, so I'm working on a few parts for official vehicles, like bumpers etc.

    My question is, if i want an UV map as overlay for the (in this case) sbr material, I'm supposed to create a 3rd UV Map in blender and add this 3rd map to the materials.cs for my new sbr material, right?

    So far i have this :

    The 3rd UV Map the AO is baked to


    The materials.cs lines
    Code:
    singleton Material(sbr_modname_a)
    {
        mapTo = "sbr_modname_a";
        diffuseMap[3] = "vehicles/sbr/modfolder/bumper_ao.dds";
        diffuseMapUV[3] = 3;
        diffuseMap[2] = "vehicles/sbr/sbr_c.dds";
        specularMap[2] = "vehicles/sbr/sbr_s.dds";
        normalMap[2] = "vehicles/sbr/sbr_n.dds";
        diffuseMap[1] = "vehicles/sbr/sbr_d.dds";
        specularMap[1] = "vehicles/sbr/sbr_s.dds";
        normalMap[1] = "vehicles/sbr/sbr_n.dds";
        diffuseMap[0] = "vehicles/common/null.dds";
        specularMap[0] = "vehicles/common/null.dds";
        normalMap[0] = "vehicles/sbr/sbr_n.dds";
        specularPower[0] = "128";
        pixelSpecular[0] = "1";
        specularPower[1] = "32";
        pixelSpecular[1] = "1";
        specularPower[2] = "128";
        pixelSpecular[2] = "1";
        specularColor[0] = "1 1 1 1";
        specularColor[1] = "1 1 1 1";
        specularColor[2] = "1 1 1 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";
    };
    The result is this though,
    screenshot_00235.png
    instead of


    as you can see, the the AO as overlay itself works, but it just seems to use the wront UV Map. is there anything else i should do to apply it to the 3rd or is it simply impossible?
     
  2. meywue

    meywue
    Expand Collapse
    Administrator
    BeamNG Team

    Joined:
    Nov 19, 2015
    Messages:
    339
    Hey,

    we're just supporting up to 2 UV maps. Also...

    Code:
    diffuseMapUV[3] = 3;
    ... would be the fourth UV map ;)
     
  3. Uanpis

    Uanpis
    Expand Collapse

    Joined:
    Mar 11, 2018
    Messages:
    57
    I've never messed with vehicles, but in static objects you can only have 2 uv maps, so I think that applies to vehicles too.
     
  4. NinetyNine!

    NinetyNine!
    Expand Collapse
    Vehicle Artist
    BeamNG Team

    Joined:
    Feb 17, 2016
    Messages:
    1,343
    oh okay i see, but a 3rd layer on the 2nd uv map would work? (the one for skins)
    if it does, would you mind telling me how to do that? :) AO would really help with the looks of it because its really bland without it and id have to map it to something black instead
     
  5. Uanpis

    Uanpis
    Expand Collapse

    Joined:
    Mar 11, 2018
    Messages:
    57
    You should get ao if you check SSAO in the graphics settings
    Screenshotfrom2018-04-04183224.png
     
  6. NinetyNine!

    NinetyNine!
    Expand Collapse
    Vehicle Artist
    BeamNG Team

    Joined:
    Feb 17, 2016
    Messages:
    1,343
    thats not what i mean, I'm talking about baked AO as a texture.
     
  7. Uanpis

    Uanpis
    Expand Collapse

    Joined:
    Mar 11, 2018
    Messages:
    57
    I know, but you were talking about it being very bland, so maybe you didn't know there was already an ambient occlusion option in the game.
     
  8. NinetyNine!

    NinetyNine!
    Expand Collapse
    Vehicle Artist
    BeamNG Team

    Joined:
    Feb 17, 2016
    Messages:
    1,343
    nah i do, i have it activated ;)
     
  9. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,683
    The 'diffuseMapUV[3] = 3;' thing allows you to choose a different UV map (model must have) for that specific texture.
    UV map counting starts from 0. So if you have 3 UV maps in your model, you'd count 0,1,2 (latter being the third one)

    Also note that texture is overlayed normally (not multiplied).
    So you'd need to turn the white parts into alpha. You can do that easily with GIMP (there's a button to convert a color into alpha). I did that on the 'minicity' textures on my latest map, which you can take as example.
     
    • Like Like x 1
    • 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