1. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    Solutions and more information may already be available.

colorMap vs diffuseMap (materials.cs)

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by thomatoes50, Feb 19, 2016.

  1. thomatoes50

    thomatoes50
    Expand Collapse
    Staff Member

    Joined:
    Jan 31, 2013
    Messages:
    616
    So what the differences?

    I have a materials.cs which have both and when i try to add some material they still show up as the no material texture ( double checked the file path )

    By the way, Is there a limit for materials ???
     
  2. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,425
    Do you mean your materials file has duplicate materials with different properties? If that's the case then the material listed lowest in the hiearchy will be used. Does the name of your mateiral match the name in the materials file?

    For example if the name of the material in your 3D program is "Ruby_Red" then the material file should look like this:

    Code:
    singleton Material(Ruby_Red)
    {
       mapTo = "Ruby_Red";
        diffuseColor[0] = "1 0 0 1";
        useAnisotropic[0] = "1";;
        castShadows = "1";
        translucent = "1";
        translucentBlendOp = "None";
        alphaTest = "0";
        alphaRef = "0";
        dynamicCubemap = true; //cubemap = "BNG_Sky_02_cubemap";
        instanceDiffuse[0] = true;
        materialTag0 = "beamng"; materialTag1 = "vehicle";
    };
    Note that the name "Ruby_Red" is listed as the singleton Material and as mapTo. (the first 2 lines of code)

    The difference between a diffuseMap (a.k.a colorMap) and diffuseColor is that a colorMap is going to look for a UV map with colors added to it, a diffuseColor is going to use the color specified in the materials.cs file.

    a practical example of a diffuseMap (a.k.a colorMap) is putting a 10x10 picture of a cat onto a a 10x10 plane of wood, that picture is mapped to the wood.

    a diffuseColor is changing the color of the actual wood itself to whatever color you want
     
    #2 ThreeDTech21, Feb 19, 2016
    Last edited: Feb 19, 2016
    • Like Like x 2
  3. thomatoes50

    thomatoes50
    Expand Collapse
    Staff Member

    Joined:
    Jan 31, 2013
    Messages:
    616
    Update :
    The problem was elsewhere like everytime.


    This an explanation, maybe it can help someone else.
    When i added materials, a copy of the updated material.cs is saved to BeamNG.drive\levels\folders.....
    I manually updated the right material.cs in BeamNG.drive\mods\unpacked\GTA4_dev.zip\levels
    But i forgot to delete it.

    BeamNG will load only one of the file
     
  4. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,425
    Oh ok good you found it, yeah BeamNG caches alot of stuff
     
    • Like Like x 1
  5. thomatoes50

    thomatoes50
    Expand Collapse
    Staff Member

    Joined:
    Jan 31, 2013
    Messages:
    616
    Your explanation is really good. maybe you can create a wiki page about this?
     
  6. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,425
    I'll ask the devs If I can but I dont know enough yet to build a wiki page, for example I still dont know how to make breakable glass or what the levels of materials mean
     
  7. thomatoes50

    thomatoes50
    Expand Collapse
    Staff Member

    Joined:
    Jan 31, 2013
    Messages:
    616
    Anyone can write on the wiki. In a post I saw earlier, someone complained about the lake of information and the devs answered him that the community can and should write on the wiki when it's possible.
    Don't know anything about breaking glass but the levels is like layers, you can use a different uvmap for different layers like skin.
     
  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