Blender to BeamNG Texture/Materials Invisible

Discussion in 'Content Creation' started by webdev4485, Jan 13, 2024.

  1. webdev4485

    webdev4485
    Expand Collapse

    Joined:
    Jan 13, 2024
    Messages:
    2
    Hey all, first post here because I'm at my whits end. I'm a programmer by trade and I really enjoy reverse engineering things to figure them out. Trying to do this with BeamNG mods has been a nightmare. I've been reading what I can on the wiki, but I can't seem to get anything to work.

    So, I decided to try something super simple. I am making a cube, with a texture. What I have done so far:
    1. Make a default cube in Blender (1/1/1m) and name it `test`
    2. Add a material to it called `test_material`
    3. Switch to UV Editing, make a texture called `test_texture`
    4. Change my materials base color to an Image Texture pointing to `test_texture`
    5. Export (using plugin) jbeam.
    6. Export collada and texture
    In Blender the cube looks exactly as I would expect:
    upload_2024-1-13_11-6-26.png

    The collision and nodes are working in game, but the object is invisible:
    upload_2024-1-13_11-14-30.png

    I would like to use materials 1.5, but I couldn't get the `main.materials.js` to work. Here is what I tried:
    Code:
    {
        "test" : {
          "name" : "test_material",
          "class" : "Material",
          "mapTo" : "test_material",
          "persistentId" : "e4371f2e-85d7-4247-b161-e0b746a9c246",
          "Stages": [
            {
              "baseColorMap": "vehicles/test/test_texture.png",
              "metallicFactor": 0,
              "roughnessFactor": 1,
              "useAnisotropic": true
            },
          ],
          "dynamicCubemap": true,
          "materialTag0": "beamng",
          "materialTag1": "object",
          "order_simset": 0,
          "version": 1.5
        }
      }
      

    I also tried a `materials.cs`:
    Code:
    singleton Material(test_material)
    {
       mapTo = "test_material";
       diffuseMap[0] = "test_texture.png";
       specularPower[0] = "15";
       useAnisotropic[0] = "1";
       castShadows = "1";
       translucent = "0";
       alphaTest = "0";
       alphaRef = "0";
    };
    Any insight on what I'm doing wrong would be greatly appreciated. Honestly I don't even want to worry about texture's right now. I would really be fine with a solid color that I can edit in game (ie car paint color). I'm not sure if I can do that without a texture image though. Please let me know.

    Thanks!
     
  2. webdev4485

    webdev4485
    Expand Collapse

    Joined:
    Jan 13, 2024
    Messages:
    2
    Well, I think part of it was that I was missing the `flexbodies` tag. It worked for my cube, and for my more complicated project.
    upload_2024-1-13_19-19-8.png

    Next question is then, how do I do a solid color without a png texture file? Is that possible?
     
  3. Murokmakto

    Murokmakto
    Expand Collapse

    Joined:
    Dec 24, 2023
    Messages:
    248
    Hello there, this looks rather similar to the problem I had described in this thread...
    https://www.beamng.com/threads/how-to-create-a-map-backdrop.95767/page-2

    BeamNG wants for some reason this setup in blender, otherwise the materials are just invisible:

    upload_2024-1-18_21-10-38.jpeg
    Afaik you need to set it up like this in blender: name your original Cube "test_a50" and then duplicate it, name the other "test_a500", the numbers refer to the Lod distance of the object. But for the sake of testing it does not really matter, just take random numers between 1 and 500. As long as you do not have a duplicate and both called xxxx_NUMBER like "test_a150" and "test_a300", the object will show up invisible in BeamNG. I don´t know why that is.

    ...and I´ve been using this template someone created for BeamNG. I don´t know if its necessary to use it because I have very little knowledge of blender but it worked for me.
     
  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