Base texture (t_terrain_base_b) not working

Discussion in 'Content Creation' started by Maris_Piper, Mar 5, 2023.

  1. Maris_Piper

    Maris_Piper
    Expand Collapse

    Joined:
    Jan 22, 2023
    Messages:
    24
    Does anyone have any idea why my base color texture is not displaying in-game?
    I have created a color map for my base texture and placed it in each of the terrain material's base texture slot.
    The resolution matches, and I have double checked each texture channel, and I can't figure out why it won't work.
    When I zoom out to the map, the terrain is just super dark brown, almost black. Like there's no base texture at all (see attached image).

    Anyone know what's up with this? I have spent a lot of time making roads but I'm starting to worry that this problem won't ever be fixable and I've been wasting my time.
    Any advice would be greatly appreciated, thank you!

    - Maris Piper
     

    Attached Files:

    • POST.jpg
  2. AlexKidd71

    AlexKidd71
    Expand Collapse

    Joined:
    Mar 16, 2022
    Messages:
    492
    What’s your detail strength? This should be very low like 0.1 or 0.2. Press save to file to see the change.
     
  3. Maris_Piper

    Maris_Piper
    Expand Collapse

    Joined:
    Jan 22, 2023
    Messages:
    24
    I'm afraid I'm not sure what you mean. Is this value found in Photoshop, or inside BeamNG level editor?
     
  4. Maris_Piper

    Maris_Piper
    Expand Collapse

    Joined:
    Jan 22, 2023
    Messages:
    24
    I did end up loading the map editor up shortly afterwards, and I found a box for detail strength. I messed around with it for a while but I never seem to get any visual difference even when I save the changes.
    Pic related is the last configuration I had, and still no visual changes occurred. I do think I'm on the right tracks here though, thanks to your advice.
    I think that the texture system is quite convoluted, but I'm determined to figure it out.
     

    Attached Files:

    • POST.jpg
  5. JoshCo2

    JoshCo2
    Expand Collapse

    Joined:
    May 21, 2016
    Messages:
    22
    On this last screen shot it shows 4096 and the base is set to 2048. These definitely need to match. But on your first pic they do so.....? Only other thing I can think of that makes things dark like that is missing ambient occlusion for the base map.
     
    • Agree Agree x 1
  6. Maris_Piper

    Maris_Piper
    Expand Collapse

    Joined:
    Jan 22, 2023
    Messages:
    24
    I must admit, I didn't realize that was left at 4096 when I took the screenshot. I was at a point where I was just fooling around with any and all of the values, trying to get something to change. I guess I forgot to put that back, however even now it's back at 2048, still nothing.
    I really like your idea about the AO map being the culprit. This is something I didn't even think of, but I have ran into comparable issues in 3DCG software by incorrectly configuring Ambient Occlusion. I am about to load the map editor and mess around with this idea, I will post again shortly.

    I hate to ask such specific questions when they've probably been asked before, but I am worried about continuing my map without fixing this first. Just in case it gets to a point of no return, or something. I feel like the base texture is the last big hurdle I have before I can fully commit to my project (which has already taken 170hrs of learning, lol ).
    With that being said, I really don't fully understand the way the terrain textures work, and even the official documentation did not help much. Why does every single texture have to have a 't_terrain_base_b'? I don't understand how it corresponds to any of the individual materials that make up a terrain. Why does 'mud' need a color map for the whole level, rather than just the muddy parts? And then every other terrain material also has one? Confusing, even for someone like me who enjoys tedious computer problems. :cool:
    --- Post updated ---
    I definitely think you're onto something here, so thanks for pointing me in the right direction. I thought these vague road markings were just decals left over from the template map which I hadn't deleted yet. Turns out they're baked into the terrain itself, and are non-selectable. After inspecting the AO maps, they look like they have the same impressions on them. Could this be confirmation that my AO maps are all messed up?
     

    Attached Files:

    • mapscreenshot.jpg
  7. AlexKidd71

    AlexKidd71
    Expand Collapse

    Joined:
    Mar 16, 2022
    Messages:
    492
    The t_terrain_base_b gives the maincolor to your texture at any point of the map if you paint terrain there. Just go to a vanilla level, hit F11 and export the terrain in the terrain tools.

    001.png

    Then take a look at the exported files. You should have a black and white png for every terrain type which is used in the map. If you examine the grass png for example all the white ares are painted with grass.

    If you lay this image file over the t_terrain_base_b file in photoshop or gimp with a little opacity on the uppper layer you see exactly in which color the grass (white areas) is painted on your map. Just try to paint asphalt terrain on a grassy spot in the vanilla level. It will be greenish (the underlying color of the t_terrain_base_b and not grey.

    Try to imagine that all of the exported terrain png merged together should result in one full white image if your map is fully painted with terrain.

    I thought it would be nice to have a multicolored detail texture for the forest floor for example. But this doesn't work well because the color has to be mixed with the color from t_terrain_base_b. This looks bad most of the time. The mixing strength is defined by detail strength parameter. If you take a look at the detail textures used in vanilla maps they are mostly very desaturated because of that.

    With one t_terrain_base_b defined at any terrain texture you have the possibilty not to use the same grey for asphalt on all places and to make varieties of color of grass and forest floor. I think that's how pbr works but I have honestly no clue about it :)

    If you would colorize the white areas of each single export file from above and use it as a distinct t_terrain_base_b file for each terrain type you would have the exact same effect as using one fully painted for all terrains.

    In the phase of terrain building it really sucks that you don't see the right color if you did'nt start with a fully planned terrain and a perfect t_terrain_base_b file. Which amateur does?

    What I do:
    I link each export image mentioned above as a layer in photoshop. I mask each layer and fill the white areas with a fitting color. then I export the full image as t_terrain_base_b.
    Then the painted terrain has these colors. If I repaint terrain and export again, I just open the photoshop file and refresh the layers because they are linked to the export files I have an updated t_terrain_base_b file.

    002.png 20230307115028_1.jpg

    I just learned the above by hard try and error efforts. If I made some wrong assumptions please correct me!

    If you think for t_terrain_base_b your image dimensions are correct then check if you saved the png in 8 bit format without transparency. And don't convert it to dds. This didn't work for me for terrain textures.

    And really take a look at detail and macro strength. Your values are way too high. Here is an example from East Coast USA:

    003.png

    Best!
    Alex
     
    #7 AlexKidd71, Mar 7, 2023
    Last edited: Mar 7, 2023
    • Like Like x 4
  8. Maris_Piper

    Maris_Piper
    Expand Collapse

    Joined:
    Jan 22, 2023
    Messages:
    24
    Thank you so much for your post. This is unbelievably helpful. From the way you explained it, I think I understand it. It might take me a few hours to get any results, but I think I am finally starting to understand.
    So It's basically a jigsaw puzzle! Except you start with the full picture, then make the pieces out of that.
    Like I say, I think it will take me quite a bit more time to put this into effect, and I'll probably read your post about 600 times, but I think this is all the info I need.
    Thank you!
     
    • Like Like x 1
  9. JoshCo2

    JoshCo2
    Expand Collapse

    Joined:
    May 21, 2016
    Messages:
    22
    I've been experimenting with this and it seems to be mainly for distance but an unfortunate side effect is--like you say-- that it muddies good textures up close! So with a Blender rendered base map of textures (rocky mountains in my map) the distance view look better than uniform grey blobs. But up close, the macro texture has weird inconsistencies. A trade-off I guess.

    I've been cheating and using solid colors--green, brown, etc that (I hope) approximate my final Photoshop base map whenever I get around to making it. I just like to see green grass and grey asphalt as I am painting!
     
    • Like Like x 1
  10. AlexKidd71

    AlexKidd71
    Expand Collapse

    Joined:
    Mar 16, 2022
    Messages:
    492
    I thought about that too but never tested it. Great that it works. I probably will do the same and afterwards I use my technique to generate the final basemap and then work a bit on it. A rendered basemap would be nice but I don’t know how to exactly do that.
     
  11. Maris_Piper

    Maris_Piper
    Expand Collapse

    Joined:
    Jan 22, 2023
    Messages:
    24
    Hi again Alex, It's the weekend so naturally I'm spending all day in front of my computer trying to figure this out. One thing I'm unsure of is this (it's gonna be hard to explain so please excuse me if It's confusing).

    So, thanks to you I now understand that the terrain materials each get exported to their own 8 bit B&W png file. These 'jigsaw puzzle' pieces would all fit together perfectly to make the full terrain, and I can imagine that combined, it would be one white square.
    However, what I am having trouble with now is...In what order do these files need to be added?

    I think right now, since I've not inspected the exported terrain files yet, this would be a good place to start. My map used the driver experience center as a base, so I am guessing that the individual terrain files (the black & white ones) in my map will actually still make-up the terrain for that. Although I removed the physical terrain and replaced it with my own heightmap, I bet the terrain materials for ETK are just automatically trying to fit onto my new terrain. Therefore I must edit these files and try again.
    My plan for map development today is as follows:

    1. Open my custom map
    2. Export the terrain files - I am expecting them to be the vanilla ETK driver experience terrain files for grass, asphalt, mud, etc
    3. Use your opacity technique to correctly modify these files to fit my map and load them back into my map
    4. ??? Hope for the best
    I apologize for constantly adding to this thread, I know I am not really adding any new knowledge to it, but writing this stuff out helps me keep focused, and maybe this will help other novice modders in future too! ;)
    Thank you for your continued helpfulness and patience with this noob lol
    --- Post updated ---
    UPDATE:
    Once again you've been a great help to me in my efforts. I exported the terrain files from my map, and sure enough, they're still set up for ETK driver experience center. So you were 100% correct. These files have not been modified yet, and I am now positive that THIS is why my terrain looks like garbage.
    Pic related shows how my files look. Now all I have to do is figure out how to overlay the terrain that I actually want in Photoshop, so I can color the pieces correctly. I am going to start by loading my own t_terrain_base_b image into Photoshop, setting the opacity of each map down and coloring it in. I feel like I'm making progress here; thanks again Alex.
     

    Attached Files:

    • screenshot_map_file.jpg
  12. AlexKidd71

    AlexKidd71
    Expand Collapse

    Joined:
    Mar 16, 2022
    Messages:
    492
    I started more or less the same. I copied east coast, renamed the mapname in the paths in json. I did some basic black and white painting for my most needed terrain materials, then I deleted the terrain and the vegetation folder and all the assets in the object tree. Then I imported the heightmap and the black and white images for the terrain. good luck. If you are completely desperate we can perhaps do a zoom call one day.

    Best!
    Alex.
     
  13. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,421
    When I had issues with normal-texture formats, and tried using dds anything as of late, my terrain did that. It also does it when paths are wrong.
    The devs told me to use PNG files for terrain and the game would convert them at run-time.
    Your heightmap however is best imported as a 16-bit PNG, for the record, but that really doesn't make the terrain go black. 8-bit makes it look more like Minecraft with stair-step hills due to lack of bit-depth.

    Multiple terrains with collision is not supported. You will only get collision on a single terrain (whichever one is loaded first). Up to 8k square terrains may be used, though you will lose built-in compression (bloating file size quickly!) if you go over 4k square, so this is not always recommended.
    *If someone has a correction on this information, please hit reply and correct me on record, as that helps everyone.
     
    • Like Like x 1
  14. Maris_Piper

    Maris_Piper
    Expand Collapse

    Joined:
    Jan 22, 2023
    Messages:
    24
    You're a legend, Alex. I've been working on this since the start of the year, from scratch. I've only made it this far thanks to yourself and a few others, sharing valuable info, so thanks again.
    I will be working on this asap, and I will be putting your advice to use. Even if it means starting over (for the 20th time) then I'll do it. The many mistakes I've made since starting this has actually been very helpful, trial and error is the best way to learn.
    I'm going to try some more techniques and see what happens. Thanks!

    This is good to know. I got that awful stepping problem but only after I used an Ai to upscale the 2k map to a 4k one. It took me a few hours to manually smooth it out in game, but the terrain did come out very good in the end.
    At this point I think my main problem is the texture maps. I just can't figure out why my t_terrain_base_b isn't appearing. I see rock, mud, etc on the ground when I'm driving, but zoomed out, it's all black. As AlexKidd71 said though, I'm probably just missing something vital in the way I've got the maps configured. Then when I figure this out I can get back to making roads!

    Thank you for the tips, it's very much appreciated
     
  15. AlexKidd71

    AlexKidd71
    Expand Collapse

    Joined:
    Mar 16, 2022
    Messages:
    492
    I solved the stepping by applying a little bit of Gaussian blur. Make sure you use 16 bit png for the heightmap.
     
  16. el_ferrito

    el_ferrito
    Expand Collapse

    Joined:
    Sep 30, 2020
    Messages:
    484
    Bit late to this, but I find the key is 16bit greyscale and uncompressed. I export them with GIMP as I find Photoshop creates more steps. As does compression.
    --- Post updated ---
    And as Alex says, a little Gaussian is also always useful.
     
    • Like Like x 1
  17. Maris_Piper

    Maris_Piper
    Expand Collapse

    Joined:
    Jan 22, 2023
    Messages:
    24
    Alright friends through your many instances of help, I have done some experimentation and I believe there is something weird about ETK Driver Experience map. I got my terrain base texture to load into several other maps but it always turns out black/brown when I use ETK.
    Very strange. However in the mean time I am accepting that I probably have to start my map again, so I have gone ahead and started a terrain base jigsaw.
    Am I on the right track here bros? I haven't exported the layers out yet but I thought perhaps a nice simple color block map would be a good place to start.
    Thank you all for your amazing help!
     

    Attached Files:

    • update.jpg
  18. el_ferrito

    el_ferrito
    Expand Collapse

    Joined:
    Sep 30, 2020
    Messages:
    484
    Ok, so my take (which might be different to others/reality) is that you want one later that is in colour and has the texture. This can be a maximum of 4096x4096 to work.

    You can then create all the normals, etc to go with that, at the same size.

    In top of this, the alphas (black and white maps for each terrain type) can be generated. These can actually be bigger, up to 8192 x 8192, but should match your heightmap size.

    These should be simply black and white. No alpha.

    The import tool will paint that terrain type wherever there is white, and not where there is black, going down the list in order (so use a full white background for the bottom layer for ease).

    I then do an automated pain of rock onto any surfaces above a certain gradient, and export that to get the rock map, but that's just a preference.

    For more info, see the below.

     
  19. AlexKidd71

    AlexKidd71
    Expand Collapse

    Joined:
    Mar 16, 2022
    Messages:
    492
    Looks okay to me. Now you can export every layer as black and white png and import it to beamng together with the heightmap. You can safely reimport changes you make to your graphics in beamng. I tested it yesterday and it works fine (if it imports :)). If your not paranoid about your new map you can provide a donload link in a private message to me and I will have a look if I can find the problem with ETK.
     
    #19 AlexKidd71, Mar 19, 2023
    Last edited: Mar 19, 2023
  20. Maris_Piper

    Maris_Piper
    Expand Collapse

    Joined:
    Jan 22, 2023
    Messages:
    24
    Thanks for the offer! I'll send you a DM soon.
    I still haven't figured out the problem here, although I haven't spend much time on it over the past week.
    One thing I am now realizing is that I will have trouble with AO maps and reflection maps because my heightmap wasn't actually generated by L3DT - it was a heightmap I downloaded of a very big open world game that I ran through L3DT so it could output it as the correct type of heightmap. So unfortunately it doesn't have a corresponding AO or reflection image. I am sure I can find a way around this though. For now, if I can get a base color texture on my map, that will be great. :)
    --- Post updated ---
    Update: I now realize that L3DT does not even generate AO or reflection maps. I'm starting to wish the PBR update was optional or something. It looks fantastic but it makes map creation like 5x more complicated lol
     
  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