1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.36 Bug Reporting thread
    Solutions and more information may already be available.

Regression: uv1Get/uv2Get only copy half of the UV texture coordinates, breaking the GLTF exporter

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by pranays123, Aug 3, 2025.

  1. pranays123

    pranays123
    Expand Collapse

    Joined:
    Oct 3, 2016
    Messages:
    18
    There has been a regression in the GPUMesh uv1Get/uv2Get functions which cause the GLTF exporter to export 0, 0 UV coordinates for half of all vertices. I have a GLTF that I exported in October 2022 and the UV coordinates are present there. This happens on both Dx11 and Vulkan with both the Native Linux and Windows versions of the game.

    This happens because the memcpy within these functions only copies half of the required bytes—copying 1 float per uv coordinate instead of 2.


    This bug can be fixed by patching the BeamNG.Drive executable. For the 0.36.4.0.0 native Linux executable (md5 d9df9f19657818f0718b8864415d670f), changing 0x9d at offsets 0xCE4CF2 and 0xCE3B82 to 0xdd will double the number of bytes copied and therefore fix the bug.
     
    • Agree Agree x 1
  2. umustbeloggedintododat

    umustbeloggedintododat
    Expand Collapse

    Joined:
    Feb 16, 2019
    Messages:
    1,431
    where can i find these offsets in the Windows executable? I'd like to patch my GLTF exporter too, but this is not present in the Windows exe.
     
  3. pranays123

    pranays123
    Expand Collapse

    Joined:
    Oct 3, 2016
    Messages:
    18
    In order to find the bug, I created a buffer and set a watchpoint on the buffer using GDB like this:

    In the console, I ran (assuming there is already some propmesh from a vehicle mesh):
    Code:
    local uv1 = ffi.new('float [?]', propmesh.uv1Count * 2);
    print(uv1)
    
    I then took the address returned by the print and set a watchpoint on it in GDB. Then I ran this in the console:

    Code:
    propmesh:uv1Get(uv1);
    
    This should cause the watchpoint to trigger. You can then go up in the backtrace until you reach application code and subtract the base executable address in memory from $rip to get the offset into the executable of the memcpy.
     
    #3 pranays123, Sep 1, 2025
    Last edited: Sep 1, 2025
    • 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