(UPDATED) TUTORIAL: How to fix missing textures caused by the 0.22 update

Discussion in 'Content Creation' started by Dibraldinho, Apr 12, 2021.

  1. Dibraldinho

    Dibraldinho
    Expand Collapse

    Joined:
    Aug 10, 2016
    Messages:
    68
    EDIT: Tutorial was completely redone. Much thanks to Baarry5444 and Nadeox for correcting some of the info and presenting an way easier fix.

    Game updates and mods break, a tale as old as Beamng itself despite the devs and modders best efforts to prevent it. Well, here's a tutorial on how to fix missing textures caused by the 0.22 update that can be used on any mod (AFAIK) broken by it. But before, a couple of observations:

    Why did the mods break?
    The game changed the way it reads textures and now .png are not being automatically loaded if the creator of the mod didn't specify them as such in the materials file.

    What is a materials.cs file? Very basically, it's the file that tells the game which textures go where on the model of the car.

    So how can it be fixed? Changing extensions in the materials files to match the texture.


    REQUIREMENTS:

    - A text editing tool. You can use the basic windows notepad without any issue, although I would recommend you to download and use Visual Studio Code with "commented json".

    -Patience. You need to be ready to scroll through some text and be very attentious to little details.


    THE PROCESS

    Step 1: Unzip the mod.
    Screenshot72.png Screenshot73.png

    Step 2: Open the folder you just unziped and then open the materials file(s).
    Screenshot74.png Screenshot75.png

    Step 3: Compare the textures extensions in the file and their extensions in the folder (the actual textures). If they don't match, correct the file using the format it is in the folder. After doing this to ALL textures, save the file.
    Screenshot76.png Screenshot77.png
    (BEFORE) (AFTER)

    Step 4: Zip the "vehicles" folder and rename it something else.
    Screenshot78.png Screenshot79.png
    Step 5: Drop it into your mod folder and CLEAR CACHE BY DELETING THE TEMP FOLDER, this is very important.

    Done! If you did everything correctly it should work just like before the update. Enjoy :D
     
    #1 Dibraldinho, Apr 12, 2021
    Last edited: May 1, 2021
    • Like Like x 4
  2. tjs-2021

    tjs-2021
    Expand Collapse

    Joined:
    Apr 9, 2021
    Messages:
    4
    I can finally live out my JDM dreams :)
     
    • Like Like x 1
  3. JowoX90

    JowoX90
    Expand Collapse

    Joined:
    Oct 27, 2016
    Messages:
    423
    cheers, thank you for this
    --- Post updated ---
    question - is there any reason why you can't just open the image in paint.net and export it as a dds?
     
  4. Dibraldinho

    Dibraldinho
    Expand Collapse

    Joined:
    Aug 10, 2016
    Messages:
    68
    Paint.net can't convert to dds, it can only save as dds images that already are dds, at least that's how it worked out here. If you know how to actually convert it from png to dds using only paint.net, please tell me so I can update this tutorial :p
     
  5. JowoX90

    JowoX90
    Expand Collapse

    Joined:
    Oct 27, 2016
    Messages:
    423
    well i tried to export as dds and none of the textured worked so it's safe to say you're correct :p
     
  6. Agent_Y

    Agent_Y
    Expand Collapse

    Joined:
    Jul 10, 2020
    Messages:
    2,494
    In paint.net you have to choose the proper compression type or else it won't work. Look up on the wiki what kind of compression is for what kinds of textures.
     
  7. Dibraldinho

    Dibraldinho
    Expand Collapse

    Joined:
    Aug 10, 2016
    Messages:
    68
    That's why I simply said to choose BC3 Linear, it's not the best setting, but fixed all textures I tested on all mods. Besides, the wiki tells you to choose compression based on dds channels, which I have no ideia how to know which ones a texture has.
     
  8. baarry5444

    baarry5444
    Expand Collapse

    Joined:
    Apr 8, 2014
    Messages:
    376
    Just to clear some misconceptions, no, the game can still read .png textures in version 0.22. The main issue stems with the game no longer pre-caching .png textures into .dds format specified in the material.cs/main.materials.json file. So what do I mean by this?

    Previously, if you used .png textures for a mod, but you specified .dds in material.cs/main.materials.json instead, then the game would bake the material into cache, thereby converting one format into another. But as of version 0.22, the game no longer incorporates this mechanism, presumably to save loading time. In other words, mods that used to show up completely fine in 0.21 will instead appear with "NO TEXTURE" in 0.22 if its materials were implemented in this manner. To the game, it believed the file specified does not exist, so being specific with the file format in material.cs/main.materials.json is crucial.

    The main takeaway is that the game does not pre-cache materials in 0.22 for some reason, and while it's fixable, you have to be precise with the file format in the material.cs/main.materials.json file. Then again, the game developers are looking into the issue, and .dds formats are highly encouraged compared to .png and .jpg formats.
     
  9. Dibraldinho

    Dibraldinho
    Expand Collapse

    Joined:
    Aug 10, 2016
    Messages:
    68
    Thanks for the clearing up, the wiki said devs were planning on dropping formats other than dds so I thought that's what happened. Going to edit this post correcting that. :p
     
  10. Agent_Y

    Agent_Y
    Expand Collapse

    Joined:
    Jul 10, 2020
    Messages:
    2,494
    Wasn't 0.20 supposed to introduce this kind of pre-caching? And 0.22 broke it? Actually that would explain why none of the old mods got broken
     
  11. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,641
    As explained in a different thread, these are not correct. We never had any feature like mentioned above.

    Certain mods are not loading correctly because the authors never specified the texture extension in the material file.
    If you tell the game to load ../texture/myTexture.png the game will correctly look for that file.
    If you tell the game to load ../texture/myTexture the game has to guess which format the file is, and then look for it.

    In 0.22 the game is assuming you are using .dds format (which you should be using anyway..).
    So if you have ../texture/myTexture in your material file, the game will try to look for ../texture/myTexture.dds

    Cannot yet tell if it's a bug, or if it was done for some reason. We are yet to check.

    Either way, those mods are not correctly specifying their textures paths, and are cutting a corner. If you want to make your mod as future proof as possible, you should avoid that.
     
    • Agree Agree x 4
  12. baarry5444

    baarry5444
    Expand Collapse

    Joined:
    Apr 8, 2014
    Messages:
    376
    While you have acknowledged the fact that specifying an incorrect file format in the .cs/.json file causes a mod to have its textures break in 0.22, it seems my message didn't do a good job explaining my original intentions. So here's an experiment to demonstrate what I mean, as well as a rewritten observation to makes things more clear and to support said experiment.

    This is a typical example of a mod with broken textures in 0.22. In this case, the Chevrolet Corvette C7 mod by Ezo:
    screenshot_2021-04-17_10-57-39.png

    As you can see, it mostly uses .png textures, but the materials.cs file specified .dds format.
    Screenshot2021-04-17110124.png Screenshot2021-04-17110138.png

    This is what it should've looked like according to its thumbnail. Note that the mod was made around the time that 0.18 was out, and had no issues with textures in 0.19, 0.20, and 0.21.
    Stingray.png

    As a side note, .png textures still work if the format is specified correctly. Take, for instance, the Mercedes-Benz CLK55 AMG mod that I reworked:
    screenshot_2021-04-17_10-59-54.png Screenshot2021-04-17110302.png Screenshot2021-04-17110246.png

    Yes, this format is not recommended when .dds is the standard. But I did follow the convention of being specific with the file format anyways, which is why it didn't exactly had any broken materials in 0.22.

    My theory is that prior to 0.22, the game would load the textures if it can find the file name specified, but doesn't check if the file format is correct. But after 0.22, the game is extremely specific with the format, and therefore assumes the texture does not exist if said format is not provided correctly. This is what I was referring to when I originally said the game would "pre-cache textures"; it could very well be an exploit that was later fixed in 0.22 for the sake of optimization.

    And as I said before, fixing this is simple (either convert the textures to .dds or rename the incorrect file format in the materials), but this is why one has to be precise with the format when adding materials as stated in my earlier message. So hopefully I got my message fully across regarding this issue. I wasn't trying to spread any misinformation, but my point wasn't listed out properly. Hence I am sorry for the confusion.
     
  13. Dibraldinho

    Dibraldinho
    Expand Collapse

    Joined:
    Aug 10, 2016
    Messages:
    68
    Thanks for the correction, will update it with the proper info.
     
  14. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,641
    Got you. That's clearly a fault within the mod:

    The author specified the wrong file extension in the materials file.
    The game is doing the correct thing now by looking at the exact file, but since those texture paths are wrong, it cannot load the textures.




    In general these mods broke because their author have not specified the correct textures in their materials. The fact it worked so far is just by chance (or very likely was bug that we now fixed), but stuff like that is bound to break, sooner or later.

    If you want to make a own mod as future proof as possible, you should be scrupulous with these details.
     
    #14 Nadeox1, Apr 18, 2021
    Last edited: Apr 18, 2021
    • Like Like x 2
  15. Eric Alston

    Eric Alston
    Expand Collapse

    Joined:
    Jan 8, 2017
    Messages:
    26
    Thank you soo much! Wanted to leave a good message with your help and providing screenshots to help me even more! I was able to fix one of my favorite mods I downloaded and love to drive around!
     

    Attached Files:

    • Screenshot6.png
    • Screenshot8.png
    • Like Like x 1
  16. SheeshGaming420TTV

    SheeshGaming420TTV
    Expand Collapse

    Joined:
    Feb 5, 2021
    Messages:
    7
    How would i go about doing this im confused lol?
     
  17. Eric Alston

    Eric Alston
    Expand Collapse

    Joined:
    Jan 8, 2017
    Messages:
    26
    Whatever mod your using that have texture missing... you have to go into that vehicle's file and see if the files match with the material.cs file. If it has .png for like a piece of the interior and in "materials.cs" it says like .dds or whatever... just change it to .png or whatever it says to match it.
     
  18. Dibraldinho

    Dibraldinho
    Expand Collapse

    Joined:
    Aug 10, 2016
    Messages:
    68
    Which part are you confused by?
     
  19. SheeshGaming420TTV

    SheeshGaming420TTV
    Expand Collapse

    Joined:
    Feb 5, 2021
    Messages:
    7
    So just change all the dds files to png?, and im confused because the mod im trying to fix consists of a few materials files
     
  20. Agent_Y

    Agent_Y
    Expand Collapse

    Joined:
    Jul 10, 2020
    Messages:
    2,494
    If there are a few files then just do it in all of them
     
    • 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