1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

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

Materials

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by chieftec, Aug 4, 2016.

  1. chieftec

    chieftec
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    33
    ive been struggeling to add a shiney looking metal material to an object im working on, but it just ends up looking like plastic. ive thought about adding a mirror material to every engine component with diffirent reflection rate, but thought it would be to inconvenient. i have read abit about materials for the game and cannot seem to find what im looking for. Thank you!
    20160804052036_1.jpg
     
  2. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,695
    Game Materials are different from '3D Software' materials.

    In your 3D software you have 'Mirror' and all that stuff, but games do not use that.
    Each game has it's own approach to that.

    For example, this is the hatch 'materials.cs' file, in particular the 'bumpers' material


    You see there is a number in the brackets. That's the layer.
    [0] is the lowest layer, the base. We assign a 'null.dds', which makes that layer completely reflective.
    [1] is the first layer, above [0]. Here we can define the 'texture' itself.

    In your DDS, you need an 'alpha' channel.
    In this alpha channel, you control how 'opaque' the texture is.
    If for example, the alpha channel is completely white, it means it's 100% trasparent. In that case you will end up with a full-chrome material.
    If it's black, it's 0% transparent, giving it a matte look (like you have now).
    If you make it 'grey', it's 50% transparent, giving it a mixed look.

    Tune it to your own like.

    I suggest to look at how the official files deals with that to see how it works in the different cases.
     
    • Like Like x 1
  3. chieftec

    chieftec
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    33
    hmm, i just tested it out and im a bit unsure what you meant by "alpha channel" I tried opening the files in paint.net but they wouldnt, making it hard to see what you meant.
    but from what i understand you are supposed to apply a null to every texture (Diffuse, Noraml and Specular), and that makes it fully chromed, you then make the texture file transparent/see thorugh depending on how much chrome you need?
    well i tried doing that and i got the same results as earlier. i also tried removing every texture and just keep the nulls, this made it completly white, but still not chromed.

    Here is the code and file:
    singleton Material(vr6_intake)
    {
    mapTo = "vr6_intake";
    diffuseColor[1] = "1 1 1 1";
    diffuseMap[1] = "intake_texture.dds";
    specularMap[0] = "intake_texture_s.dds";

    specularPower[1] = "128";
    diffuseColor[1] = "1 1 1 1";

    diffuseMap[0] = "vehicles/common/null.dds";
    specularMap[0] = "vehicles/common/null.dds";
    normalMap[0] = "vehicles/hatch/hatch_n.dds";
    };
    singleton Material(vr6)
    {
    mapTo = "vr6";
    diffuseColor[1] = "1 1 1 1";
    diffuseMap[1] = "vr6.dds";
    normalMap[1] = "vr6_n.dds";
    specularMap[1] = "vr6_s.dds";
    specularPower[1] = "128";
    diffuseColor[0] = "1 1 1 1";

    diffuseMap[0] = "vehicles/common/null.dds";
    specularMap[0] = "vehicles/common/null.dds";
    normalMap[0] = "vehicles/hatch/hatch_n.dds";
    };
     

    Attached Files:

    • intake_texture.png
  4. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,695
    Yes, that.
    Alpha Channel = Transparency.

    In Photoshop you control it via this, not sure about paint.net


    If your texture does not have any trasparency, you will not see the chromy part.
     
    • Like Like 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