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

How do I make road textures?

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by Average Person, Jun 15, 2016.

  1. Average Person

    Average Person
    Expand Collapse

    Joined:
    Jul 8, 2015
    Messages:
    587
    I would like to know how to create road texture and import them into beamng, I would use this for things like painted lines to create highways.
     
  2. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,421
    I have LOTS of pre-made textures for my highways in Beamng.drive mods that I've made.
    If you want to create a highway, you'll be able to make any highway you want. 2 lanes, 3 lanes, pretty much anything, and they're all in speedy DDS formats. Have a look at my maps Los Injurus, and Nevada Interstate. They both have good texture resources you may feel free to use with credit of course. Just goto mods>Levels> look for Los Injurus or Nevada Interstate.
    Road textures are \art\roads\ directory after the levelname (TSH foldername for Los Injurus and Hiway2 foldername for Nevada).
    You'll have to use notepad++ (it's free/opensource) to bulk-rename the paths in my materials.cs / main.materials.json files to match YOUR map directory structure. Just close all of your other files open in it, bring up search, tab over to replace, and replace /TSH/ with /Yourmapname/ (obviously replacing your map name with what your map folder is called). Click Replace all.
    The only ones I didn't create are the dirt path, and the runway texture, and one 2-lane road that's a tad lighter than the rest which is called 'material2'. The rest of the road textures match pretty well, and if you use start and end fading of atleast 1 you'll almost never see the seams.

    There's even NOTRANS/NT suffixed textures to use on MESH roads and bridges so that they don't have issues casting shadows etc.

    Enjoy

    Oh, and btw, use paint.net or GNU Image Manipulation Tool (GIMP for short) to work with graphics.
    Save these as DDS files. Use png format for normal (blue-ish) textures though as compression tends to kill graphics used for normals (think of this as bump-mapping!). USE BC7 FOR ALL TEXTURE COMPRESSION except building textures (anything that will only be used on solid materials and never anything you want to use as a decal road), to save space use BC1 format on building textures that are opaque (non-translucent). You must use BC7 for textures with varying levels of alpha (opacity), otherwise you'll lose them and end up with black outlines like in Sonic The Hedgehog (my Nevada Interstate has this issue, but I've left it as it would bloat the texture size to almost double to fix it). BC1 only supports 1 or 0 for opacity, but is half the file size, so exercise good judgement in picking what you can use and where.

    Diffuse or Color map = This is the main body of the texture you'd normally see. The line color, the grey pavement, red brick if applicable, it's all here in this one.
    Normals= bump mapping for sake of argument, making the texture a bit NON-2D - this gives brick depth, and asphalt it's graineyness (they're usually blueish mostly, with some pink highlights)
    Specular= this is reflections, if you want a shiny road when it's raining, or lines showing up better at night, use a specular map (they're usually black and white)
    There's also alpha maps for light sources, and reflection mapping for cube-maps.
    *This post, while four years old, was edited to show all the newly required info, and remove old map names to one of my maps that was deprecated in favor of Los Injurus. Recommendations of using now-outmoded PNG vs DDS for normals was changed to show the updated BC7 texture formats supported for two whole game versions now. Use of JPG or PNG for anything other than map preview pictures or HUD/interface-only items such as the mini-map street/terrain layout, is no longer supported and will NOT work.
    Paint dot net received updates in the past year to work with BC7 texture format, and it is free, so please use it!
    --The Bob 7/2020
    *Info has been checked for accuracy, but if something should be amiss, please correct it.

    --common texture errors and fixes:
    *I'm from the future and my materials.cs file does not make textures work anymore!
    Don't be resistant to change like The Bob and still use materials.cs files in 2020, use main.materials.json files, they are the future, even if The Bob does not like that.
    *How do you edit texture files manually and why?
    Use Notepad++, though other solutions exist including Visual Studio by Microsoft which are better, but more expensive than free. The materials editor was broken early-on in development, and now should be pretty safe to use, but some of us who have been with the game longer prefer to do everything from a text editor.
    *My texture doesn't show up, and I get a giant no_texture in orange and black
    To fix, make sure your texture files are where the game thinks they are in main.materials.json and that they are the correct format and not corrupted. You can only use letters, numbers, and underscores in names, no spaces or anything other non-alphanumeric characters or the game will crash or fail to work correctly.
    Your texture must ALWAYS be in power-of-2 dimensions or it WILL NOT WORK (and if by chance it does work it will be very very slow if not power-of-2). Look up power-of-2 dimensions on wikipedia for morehelp on that. Graphics must always be at-least 32-pixels by 32-pixels, or at-least 32-pixels long in one direction.
    *My texture shows up but 'no_texture' is showing through it in a 3d embossed sort-of-way
    Error in normal maps, please use BC7 compression for these, and make sure path and file names are correct in the materials file, and correctly formed file names are used in the file name itself.
    *My texture is strangely blue or yellow but only from certain angles, or no_texture can be seen but only from a certain angle or even then 'just barely'...
    Again, please use BC7 texture format for .dds file, this will almost always be a specular map issue so try that 1st. Make sure the texture is where the game thinks it is... BC3/BC5 format can cause this issue.
    *My texture gets strangely blurry as it goes off into the distance
    Open up the material filter and check to see if the correct filters are applied to the texture.
    Enable Anistropic filtering to fix this. This blends mipmaps as the texture gets further away.
    *I can't get my building windows to light up at night and still look good in the day time!
    Currently a limit of the game engine, but to-be-fixed. Adjust alpha mapping to be neutral looking in the daytime when most folks use the game.
    *My textures are super-metallic and awesomely reflective, but they shouldn't be!
    You left cube-maps enabled or copied a cube mapped texture entry, added your own stuff, and forgot to disable cube-mapping! Cube mapping is good for chrome bumpers/trim, mirrors, windows, and the like.
    *My skybox doesn't work but it's in .dds like it's supposed to be!
    Try png format for the skybox, don't ask why, it adds a little stutter but gets rid of the error.
    *My shadows don't look right, or don't show up when they're supposed to!
    Make sure to go into the materials editor and flick off cast_shadows for decal road textures, and to flick them on for solid / opaque textures (and also any textures you used BC1 format with).
    For decal road textures or ones you can see through -
    Cast shadows = 0
    Translucent = 1
    Translucent Z-write = 1
    For opaque or solid textures like brick, stone, or the asphalt used on bridges, use the following
    Cast shadows = 1
    Translucent = 0
    Translucent z-write = 0
    The argument with translucent z-write has to-do with translucent textures like window glass you can still mostly see through, so do try toggling it if something doesn't look right.
    *My texture flickers like crazy, and I can't stop it, but only near other textures
    You used an opaque solid-object-only texture and tried to layer a non-solid (decal road) texture over it, this does NOT work, and will result in z-fighting (which is the error you see)
    *My texture appears too dark, too translucent, or too washed out or non clear enough
    Make sure to properly set your alpha levels and RGB color levels to your textures, the format is RGBA
    Red, Green, Blue, Alpha. Alpha is the transparency/translucency of the object, useful for glass, or for certain types of roads you're trying to make.
    *I made my own normal maps using the Photoshop or GIMP normal map plugins, but they look inverted
    Try toggling the X and Y toggles on the normal map generation window, inside your photo editing software, when you generate the normal map. You may want to try flipping them as sometimes depending on the source picture, it'll get them backwards. Just keep trying until it looks right.
    *My textures get very grainy when moving away, or just plain look bad from distance, and I can't figure out why
    This has to do with mip-maps, try using better pre-generated mip-maps when saving your file in photo editing software, and this includes your normal maps, too.
    *I can't get my texture to show up on my in-game 3D object / model I imported
    Textures are referenced by models with their map_to name. So if your boring_road texture entry has a map_to entry in the materials atlas called 'road', that's what you'll name the material in your object, 'road'. Using the name 'boring_road' won't usually work unless you name the map_to field to match that.
    You do not need to fill out the map_to line if you are just only using the texture for a decal road, but if you are making an opaque texture and DO make your own models or use in-game ones, it's a good idea to fill it out if it's not filled already. This follows the same naming requirements as file names and paths with what characters are allowed or not.
    *My textures look washed out and I used BC7
    You may wish to, before creating tons of properly formatted textures, see what works best for you. sRGB BC7 may appear washed out or over-bright, while Linear BC7 will look fine. This is a bug, it was fixed, and then it became broken again.
    *My model textures didn't work, but now I fixed them, but the ones far away are still orange / orange no_texture!
    Clear your cache. Always test your map in .ZIP form to make sure it's well fixed AFTER clearing cache.
    *I cleared cache like you said but my map is gone, I HATE YOU!
    No, just do a folder search in your beamng documents folder for 'backups' and look for your maps folder, it's hidden there. This may or may not still happen, but it happened to me in 2016 once and I got quite the scare.
    you can always clear cache manually by looking for the levels/your_map_name_here in the current version's cache folder. Cache always regenerated between game versions, however.
    *My texture worked in the old version but not in the new version!
    Re-copy your models and assets over from the source map to your map if using stock assets, as they may change between versions, and sometimes this can break the models in your map. If this doesn't work fully, consider looking at the source map's main materials file (texture atlas) for any changes or difference in the texture in question. The file name, or files used could have changed. This is to-be-expected with Early Access software and games. Make sure you're using a supported format if using your own models/textures.
    UNCONFIRMED: Textures can sometimes conflict with those in the base game, if adding your own textures, be aware that this CAN happen, but doesn't always. It HAS happened to me before though.
    *My texture does not work no matter what I do and the console tells me something about re-declaring.
    If you have a model or forest object named traffic_light, and a texture named traffic_light, the texture will cease to work because that class is already taken by the model itself, give the model / model class a different name in the forest brush (and edit it accordingly in the forest database if you have some already in the map!), or give the texture a different name and change the one the model looks for within the model itself (this is recommended). You can always text-edit the change in the model if you're super-duper smart / handy. This came into effect in 0.8 or 0.9 game version a few years back with the new forest brush format. Like-wise, with sounds too, make sure all names are unique.
    *My map doesn't load, or crashes the game!
    Corrupt formatted file in the /main/ folder, restore from backup. Corrupted models or texture files themselves can also cause a crash, though usually textures will just revert to 'no texture'.
    *I have some other stupid error and now the game isn't reading any of my textures in directory X
    Make sure you haven't accidentally bumped a key when entering your info manually into a materials.cs or main.materials.json texture-atlas file. If you messed up a file name, most will still work, but if you messed up the formatting or context, or forgot a " or a [ or a ] or even a ; it could be curtains for your file. Go back and take a better look at it and if all-else fails, add the entries back one by one until it breaks.
    If you have cats, NEVER, EVER, EVER let them near the keyboard with your texture atlas files open when manually editing them, even if you walk away for only a minute. Do not ask how I know this either.
    *How do you know that?
    OK shows over, everyone go home, and happy Beamng mapping.
    ALWAYS BACK UP at-least every 5~10 working days. DO NOT keep the backups only on your computer. One blast of lightning or angry cat peeing on the tower could ruin your project, always backup and give a trust-worthy friend a copy for safe keeping. Many good projects have been lost to data crashes, don't be a statistic. Seriously, you can jam so much junk on a 5~10$ USB drive it's not even funny, back it up.
    Always have a friend who has BeamNG handy to test your map zip file before you submit it. The folder structure in the zip must start with /levels/your_map_name, not just your map name. Do not attempt to use 7zip format for beamng site uploads, it will reject it, just use the zip format. You can still use the 7-zip software to do this, however, with no ill effect.

    Texture atlas is a name used to refer to the deprecated materials.cs and current main.materials.json file. It contains everything the game needs to know about your textures. Do not design a new map mod using materials.cs, please convert this to main.materials.json before you share it with the world, so that it's not broken so soon.
    Translucency and transparency, may have been used interchangeably here, but should be good enough for the sake of argument.
    Mip-Maps are progressively lower-res textures drawn in by your video card on textures far away, so it can fill the triangles with texture faster. This has been around for a good solid 20 years now.
    Anisotropic filtering is used to lessen the jarring transition between highest-resolution textures and the first and second (and so-on) levels of mip-mapping, so you don't see a hard line a half-block or full block away in the detail of the road textures (or any other textures, for that matter). Find what works best to you, but don't leave it ugly looking. This became common in games around the early to mid 2000's.
    DO NOT go wild like The Bob and heap on the 4k and 8k textures and then expect people with 1gb and 2gb video cards not to come for him packing weapons of all kinds. Video RAM is very limited, and is along with draw calls one of the most restrictive parts to 3d scene / game design that there is. Try to find a good balance to where the map looks good and has a nice variety of textures, while still making it not repeat every block or two. Keep in mind that this site has an upload limit of 500MB per mod zip file, do not go over this amount. Start with a small or modest size map and work up from there.
     

    Attached Files:

    • derp_proof_textures_july2020.png
    #2 bob.blunderton, Jun 15, 2016
    Last edited: Jul 25, 2020
    • Like Like x 2
  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