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.30 Bug Reporting thread
    Solutions and more information may already be available.

Custom Road Textures not working

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by Twitch Axis, Jun 28, 2017.

  1. Twitch Axis

    Twitch Axis
    Expand Collapse

    Joined:
    Dec 29, 2015
    Messages:
    504
    Usually when it comes to making maps, I know what I am doing, but in this case, something is not working right. I am trying to import some custom road textures into my map that are not Beamng property, and I am using the GridMap template.

    So from the start the a_asphalt_01_a texture is in levels/Gridmap/art/shapes/misc, but I am trying to make an entire new folder called "road" in levels/Gridmap/art. When I first started off, I figured I would cheat and just replace the a_asphalt_01_a texture with mine, but soon came to the realization that I needed more textures in game. So here I am confused as anything. I decided to take a look at how other modders did this, and completely changed what I was doing. So I took anything with the name a_asphalt_01_a from the misc folder and deleted it, including the stuff from the materials.cs file. I figured that all of that texture would go away now. Well when I went in game to check it out, that texture was still showing up even when I had deleted all traces of it, unless there is something in the .mis file, which I did not think to look in. Even still, it would be mapping a texture to an image that does not exist.

    So I created my roads folder in levels/gridmap/art and created a materials.cs file in there and took my textures which I renamed to "MainRoad" and "3Lane". From my knowledge I wrote the materials.cs file correctly, mirroring what I had looked at previously. I go into the game and take a look and still the a_asphalt_01_a is showing up with the texture on the roads I had already put down, but the MainRoad and 3Lane were still no place to be found. I even added a material tag, RoadAndPath.

    Code:
    singleton Material(MainRoad)
    {
        mapTo = "unmapped_mat";
        diffuseMap[0] = "levels/highway/art/road/MainRoad.jpg";
        materialTag0 = "RoadAndPath";
        useAnisotropic[0] = "1";
        castShadows = "0";
        translucent = "1";
        translucentZWrite = "1";
        materialTag1 = "beamng";
        specularPower[0] = "1";
        specularStrength[0] = "0.588235";
    };
    Now you are probably looking at this and thinking, "AIM, you idiot, you don't have the write file path", but the name of my folders are highway and, everything works out and I have no missing files, because I followed the directions I always have. I played around with the "mapTo" and had it MainRoad and unmapped_mat. Doing so, it still had no impact on seeing or not seeing the texture in game. I am not sure if I am doing something wrong or what. I will attach some pics and the file below for you to check out. Also, yes I know my custom object library is a mess, I am working on fixing that.

    BTW I have this mod unpacked so that is why the files aren't quite right. Thank you in advance to anyone who can help me.
     

    Attached Files:

  2. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    it works

    most probably check this folder /Documents/BeamNG/level/highway/art/road
    if there is a material.cs delete it.
    BNG write there if the editor made some change, you have to check yourself and/or copy manually back to the unpacked folder
     
  3. Twitch Axis

    Twitch Axis
    Expand Collapse

    Joined:
    Dec 29, 2015
    Messages:
    504
    Ok I will try that. Thanks!

    Edit:

    I deleted the materials.cs file and still it did not work. I even deleted the entire misc folder, (it isn't in use) and the a_asphalt_01_a still shows up as the texture I want, but I still cannot add textures!
     
  4. Twitch Axis

    Twitch Axis
    Expand Collapse

    Joined:
    Dec 29, 2015
    Messages:
    504
    I got it to work! I just misunderstood what you were saying. Thanks for your help!
     
  5. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    For those reading this, don't use JPG or GIF or other NON-.dds formats. Use .dds texture formats.
    Textures must also be 2:1, 1:2 & power-of-2 (also they can be square)
    My levels have lots of textures under /art/roads directory (that's ROADS not ROAD), if you're making a decent map feel free to use some.

    32,64,128,256,512,1024,2048,4096,8192 etc
    They can be twice as wide as they are tall, or twice as tall as wide, or square, but I don't think the game supports 4:1 ratio, if I remember correctly (pretty sure on this!).

    So 512x1024 works, but 512x2048 won't work.
     
    • Informative Informative x 1
  6. Twitch Axis

    Twitch Axis
    Expand Collapse

    Joined:
    Dec 29, 2015
    Messages:
    504
    Ah, ok I will look at that as well, I had jpg format for all, even though the game somehow read them. Also my folder was road not roads. I will take a look.
     
  7. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    Well it doesn't matter if the directory is roads or road, it just means you have to make sure it's right in materials.cs.
    If you don't use .dds the textures might not work for some people, and the map will only be half the FPS. Make them into .dds textures with paint.net, use DXT5 format when it asks you while saving, not DXT1, for road surfaces (you don't need to select other options).
     
  8. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    yes jpg or png works but from far away you will see weird noisy texture because it doesn't have mipmap (precalculeted lower resolution)
    And DDS are more optimised for GPU. if you don't give the game DDS it will have to convert them to something.

    check this guide to export texture
    https://wiki.beamng.com/Exporting_Textures_-_DDS_Files
     
    • Informative Informative x 1
  9. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Interesting. I have noticed severe blurring at a distance on road textures lately. Anisotropic filtering is enabled. Are you saying .dds mipmapping
    can help alleviate this in BeamNG? If so would you mind explaining it a bit more?
     
  10. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    no i say it will produce this effect.

    If it produce this

    them you need to convert DDS and create mipmap
     
  11. Twitch Axis

    Twitch Axis
    Expand Collapse

    Joined:
    Dec 29, 2015
    Messages:
    504
    I will definitely change those over to .dds, I have been using paint.net as well for this entire project.

    most of my issue here is just creating more roads. I did this once but suddenly, doing the same thing doesn't work anymore. Is there anyway that someone could create a step by step video to show the process of creating your own road textures? I mean like setting up folders and materials.cs. I have my materials.cs correct, but nothing is showing up in the editor.
     
  12. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    • check if the name of the material doesn't "collide" with another material in the same file or another file.
    • check if you have another material.cs in Documents/BNG/level/........
    • restart the game (if you change material.cs the game may not reload them)
     
  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