Unsolved Material mapping error: glass in unknown? how do you fix this?

Discussion in 'Mod Support' started by hardeepreehal, Aug 30, 2021.

  1. hardeepreehal

    hardeepreehal
    Expand Collapse

    Joined:
    Oct 18, 2017
    Messages:
    16
    Hello, I'm trying to import my .dae file into the game and so far I have imported one part of the model (the chassis) with the full JBeam Structure, it appears in the game however it's missing a glass texture whereas all the other textures are correct. In my .dae in Blender, the chassis is a seperate part of the mesh, within the chassis is multiple material slots and one of them is called "glass" which links/mapped to glass.png

    I have checked the console and I see this is the error:

    [NO-TEXTURE] Unable to find material mapping to: glass in unknown

    I tried making a materials.cs which contains:

    singleton Material(glass)
    {
    mapTo = "glass";
    diffuseMap[0] = "glass.png";
    specularPower[0] = "15";
    useAnisotropic[0] = "1";
    castShadows = "1";
    translucent = "0";
    alphaTest = "0";
    alphaRef = "0";
    };

    The error disappeared in the console, however the glass texture didn't appear.

    My textures are actually all .png files and I believe they automatically load in the game when the .dae and the textures are in the same folder, this explains why my license plate texture loaded automatically as well as other textures. However, the glass texture isn't working and I don't know why, could it be something in my model in blender that's causing the issue?
     
  2. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,058
    Possibly the fact that you used a generic texture name "glass" that is definitely used by some vanilla vehicles? Don't use names like this, change them to be more unique.
     
  3. hardeepreehal

    hardeepreehal
    Expand Collapse

    Joined:
    Oct 18, 2017
    Messages:
    16
    I changed it to vehicle_junk_glass and changed it in materials.cs as well. Didn't work - the glass texture still is not appearing for some odd reason, it's just invisible.

    Also I have 2 jbeams, only one of them loads (chassis.jbeam) and not the other (exhaust.jbeam). strange - it's not even mentioned in the console either.
     
  4. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,058
    Maybe if you sent the whole mod I would be able to figure it out, that's weird. One more thing, remember that the cs format of materials is technically unsupported so it might not work properly, try switching to json and see if it works then.
     
  5. hardeepreehal

    hardeepreehal
    Expand Collapse

    Joined:
    Oct 18, 2017
    Messages:
    16
    Sorry for the late reply, I was testing some stuff out with the mesh and one thing I tried was removing all the materials and placing a simple white image texture (also doing bake ambient occlusion in Blender) and turns out, not the entire chassis is showing up and also part of the door is folded inside out. So it's probably the mesh I think. I might try obtain the model from a different source perhaps
     
  6. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,058
    Yeah random models downloaded from random websites have problems like this lol
     
  7. hardeepreehal

    hardeepreehal
    Expand Collapse

    Joined:
    Oct 18, 2017
    Messages:
    16
    upload_2021-9-1_19-29-36.png

    This is what It looks like, so it seems to be a problem with the mesh, however it looks normal in Blender, probably doesn't like it when it's imported in the game though.
     
    #7 hardeepreehal, Sep 1, 2021
    Last edited: Sep 1, 2021
  8. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,058
    If it looks normal in Blender then it probably needs a double sided material, I believe that's just a few lines in the materials file, not sure if it's possible in cs format but should be in json
     
  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