Mesh not appearing in game.

Discussion in 'Content Creation' started by mehio, Jun 30, 2018.

  1. mehio

    mehio
    Expand Collapse

    Joined:
    Jun 20, 2018
    Messages:
    152
    Hi
    Please find attached file.
    Ive been following the tutorial up until exporting as .DAE and creating materials.cs but I still cannot see my mesh ingame, only the nodes and beams.
    Thank you!
     

    Attached Files:

  2. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,685
    Mesh name does not match:


    You need to use the same name you used in your model.
     
    • Informative Informative x 1
  3. mehio

    mehio
    Expand Collapse

    Joined:
    Jun 20, 2018
    Messages:
    152
    Thanks that worked, Blender can be confusing.
    Now the texture isnt showing up ingame.
    Any help please?
    Please find attached file.
     

    Attached Files:

  4. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
  5. mehio

    mehio
    Expand Collapse

    Joined:
    Jun 20, 2018
    Messages:
    152
    Hey thank you for your answer .
    In the links you sent me i found an explanation to how to make the material appear ingame. I already have that covered and working but the texture im choosing is not appearing. Ive been following the introduction to vehicle creation and im at the point where hes modifying the material in GIMP to get a texture and appear in the game.
     
  6. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Texture will work when you have correct path and filename in your diffuseMap, be certain you use / and not \ in path, also beamNG tends to be case sensitive, so make sure that is correct.

    In materials.cs file that is in your vehicle folder, make sure you have this line correctly set up, that is only thing that affects to textures showing up or not, if your material definition is set up correctly:
    diffuseMap[0] = "vehicles/yourvehiclename/yourtexturename.dds";

    If you are not using dds texture, then you change extension to match image you created.
     
  7. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,290
    It *NEEDS* to be a .dds direct draw surface texture.
    Direct Draw 1 is okay for opaques.
    Direct Draw 5 is used for either translucent/transparent textures but can also be used for completely opaque ones. If you use Direct Draw 1 on a texture like glass or a decal road, you will not be able to see through it, and transparency can only be yes or no, nothing partially translucent.
    You can see an example of what happens when you stupidly use Direct Draw 1 on a texture in my Nevada Interstate map, where there's 1-pixel-wide black outlines on all the decal road textures. Derp!

    Now, for the original poster:
    Open up your DAE file and figure out what MATERIAL it's calling for.
    Code:
    <library_materials>
        <material id="phong1" name="phong1">
          <instance_effect url="#phong1-fx"/>
        </material>
        <material id="concrete_plain" name="concrete_plain">
          <instance_effect url="#concrete_plain-fx"/>
        </material>
        <material id="CRS_Highwaytwolanebridge" name="CRS_Highwaytwolanebridge">
          <instance_effect url="#CRS_Highwaytwolanebridge-fx"/>
        </material>
        <material id="CRS_concreteramp" name="CRS_concreteramp">
          <instance_effect url="#CRS_concreteramp-fx"/>
        </material>
        <material id="retainingwall" name="retainingwall">
          <instance_effect url="#retainingwall-fx"/>
        </material>
      </library_materials>
    
    Somewhere, it could be the beginning, or at the bitter end, it's calling for materials.
    Where it says material id="CRS_Highwaytwolanebridge" & name it means it's looking for the name (from the materials.cs in the directory's MAPTO field) of CRS_Highwaytwolanebridge.
    If it doesn't find a texture with that exact name IN THE MAP TO FIELD of the texture, in materials.cs, you will have NO TEXTURE on things. Unless you like orange a whole lot, don't do this.
    Please also after you get it working, delete your cache object inside of beamng.drive\cache.12.0.4.?, (it would be a CDAE file, a compressed DAE generated at run-time by the game) so that it doesn't look bad when viewed from far away. Do that if you change your model, or if you have texture errors which you recently corrected. This goes for map models, vehicles, whatever.

    You can use Notepad++ or your preferred program to open a DAE, they're plain text, but be careful editing and do have backups, try changing your texture references inside materials.cs where your texture files are at first if you can help it. This is less destructive.

    If you need to change it in the DAE file do it in the texture thingie inside of Blender/Maya or BULK REPLACE it, do not solely change one of them or you'll likely break the texture links in your model.
    Always do a check of texture links once you export.

    This code is merely from one of my models that I happened to have open. It's easy for the stupid modeling programs to append the name -material on the end of your texture sometimes. Make sure it's calling for the right thing.

    --That should be enough.
     
    • Informative Informative x 2
  8. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    He is making vehicle with vehicle tutorial, that tutorial uses .png as texture format and with vehicles texture stuff is bit different from maps, easier in some ways, but then there are more layers to deal with (that [0] in diffuseMap[0]).

    All that is really needed with a vehicle is to have mapTo name and name of material inside Blender to be exact same name. (material settings and textures inside Blender are completely ignored in game, only UV-mapping in addition to material name is read by the game ).
    Then materials.cs in folder of mod having that diffuseMap[0] line set to correct path with all the ; at end of lines and other things precisely as instructed, then texture will show up. There is really nothing else that affects to texture showing up or not.

    Maybe with exception of conflicting material, that would be material name inside of materials.cs (singleton Material(Tug_body) not being unique enough.
    Tug_body_mehio would be better practice, for avoiding conflicts, imo). Same goes for mapTo and Blender material naming, adding modder's name to end of material name will lessen chances of conflict.

    Renaming material inside Blender to something else and then back again can sometimes help though.

    Only once I had trouble with model not showing up, even it had right name, double clicking object name in Blender and writing new name did not help, but when selecting rename, that did work, who knows what gremlins were at play there, maybe it was because of cache, maybe it was bug in Blender, but using right click and selecting rename made it to work again.


    Everything else is just confusing clutter in regards of getting texture to work, well that is my experience at least from when I attempted to get how to get textures to work, there was tons of information, but so little about what are basic needs to get texture to work.

    Of course after getting it to work and making look nice, one needs to dwell deeper into different layers and DDS formats etc. But first step is to get basics to work and there is no need for all that complexity, which is mostly confusing at the beginning.

    Those more detailed things are very useful to know when one has basics sorted out though!


    There is also problem with that tutorial as it uses hubWheels, which are replaced with pressureWheels long time ago and setting up pressureWheels is bit more complicated, however I haven't seen tutorial for that. I think that hubWheels might still work, but after getting tutorial vehicle done, it might be good idea to convert from hubWheels to pressureWheels, but first it might be best to do as tutorial instructs to not get too much complexity too soon:
    https://wiki.beamng.com/PressureWheels
     
  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