Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.
Zero Tolerance for Disrespect

Wolfenstein (2009) *.md5r

Featured Replies

Solved by mariokart64n

  • Supporter

There's several face indices blocks (starting with 0000 0100 0200 each). You'll need to choose the suiting one.

head_abm_agt01.md5r:

 

head_abm_agt01-md5r.png

  • 2 years later...
  • Author
  • Localization
On 4/7/2024 at 10:23 AM, shak-otay said:

There's several face indices blocks (starting with 0000 0100 0200 each). You'll need to choose the suiting one.

head_abm_agt01.md5r:

 

head_abm_agt01-md5r.png

Is there any Blender plugin to import .md5r files? The skeleton data have ASCII while the 3D model data is binary from .md5r.

Edited by mrmaller1905

  • Supporter
GitHub
No image preview

GitHub - bquintero/MD5R2OBJ: An incomplete exercise is de...

An incomplete exercise is decoding some Wolfenstein 2009 geometry files (MD5R and PROCB). - bquintero/MD5R2OBJ

You need to compile it in vs. But it export only meshes without bones/skin

  • Author
  • Localization
14 hours ago, h3x3r said:
GitHub
No image preview

GitHub - bquintero/MD5R2OBJ: An incomplete exercise is de...

An incomplete exercise is decoding some Wolfenstein 2009 geometry files (MD5R and PROCB). - bquintero/MD5R2OBJ

You need to compile it in vs. But it export only meshes without bones/skin

I tried the old program MD5R2OBJ but it doesn't work for character models. I'm looking for fixed alternatives to MD5R2OBJ with support for character models.

bandicam 2026-07-10 18-06-40-584.jpg

  • Solution

image.png

ChatGPT
No image preview

Check out this chat

ChatGPT helps you get answers, find inspiration, and be more productive.
#ifndef WOLFENSTEIN_2009_MD5R_POD_H
#define WOLFENSTEIN_2009_MD5R_POD_H

/*
    Semantic POD model for Wolfenstein (2009) MD5RVersion 1.

    IMPORTANT: MD5R is a hybrid ASCII/binary stream. These structures are a
    safe in-memory representation; they are not a direct memory overlay of the
    complete file. Only MD5RSilhouetteEdge is directly overlay-compatible with
    its little-endian binary payload on a little-endian host.
*/

#include <stdint.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct MD5RFloat2 { float x, y; } MD5RFloat2;
typedef struct MD5RFloat3 { float x, y, z; } MD5RFloat3;
typedef struct MD5RFloat4 { float x, y, z, w; } MD5RFloat4;

typedef struct MD5RBounds {
    MD5RFloat3 minimum;
    MD5RFloat3 maximum;
} MD5RBounds;

typedef enum MD5RVertexSemantic {
    MD5R_SEM_POSITION,
    MD5R_SEM_NORMAL,
    MD5R_SEM_TANGENT,
    MD5R_SEM_BINORMAL,
    MD5R_SEM_DIFFUSE_COLOR,
    MD5R_SEM_TEXCOORD,
    MD5R_SEM_BLEND_INDEX,
    MD5R_SEM_BLEND_INDEX_SMALL,
    MD5R_SEM_BLEND_WEIGHT
} MD5RVertexSemantic;

typedef enum MD5RStorageType {
    MD5R_STORAGE_IMPLICIT,
    MD5R_STORAGE_FLOAT2,
    MD5R_STORAGE_FLOAT3,
    MD5R_STORAGE_FLOAT4,
    MD5R_STORAGE_DEC_10_10_10N,
    MD5R_STORAGE_DEC_11_11_10N
} MD5RStorageType;

typedef struct MD5RVertexElement {
    MD5RVertexSemantic semantic;
    MD5RStorageType storage;
    int32_t auxiliary;       /* TexCoord channel or total BlendWeight influences; -1 if absent. */
    uint32_t byteOffset;
    uint32_t byteSize;
} MD5RVertexElement;

typedef struct MD5RVertexDeclaration {
    uint32_t elementCount;
    const MD5RVertexElement *elements;
    uint32_t stride;
} MD5RVertexDeclaration;

typedef struct MD5RJoint {
    const char *name;
    int32_t parentIndex;     /* -1 for root. */
    MD5RFloat3 position;     /* Observed bind/model-space position. */
    MD5RFloat3 orientationXYZ;
    /* Omitted W is conventionally reconstructed as:
       w = -sqrt(max(0, 1 - x*x - y*y - z*z)). */
} MD5RJoint;

typedef struct MD5RVertexBuffer {
    MD5RVertexDeclaration runtimeFormat; /* VertexFormat */
    MD5RVertexDeclaration diskFormat;    /* LoadVertexFormat if present, otherwise runtimeFormat */
    uint8_t systemMemory;
    uint8_t videoMemory;
    uint16_t reserved;
    uint32_t vertexCount;
    uint32_t payloadByteCount;
    const uint8_t *payload;              /* Empty for runtime-generated VBs. */
} MD5RVertexBuffer;

typedef struct MD5RIndexBuffer {
    uint8_t systemMemory;
    uint8_t videoMemory;
    uint16_t bitDepth;                   /* 16 in every supplied sample. */
    uint32_t indexCount;
    uint32_t payloadByteCount;
    const uint8_t *payload;
} MD5RIndexBuffer;

#pragma pack(push, 1)
typedef struct MD5RSilhouetteEdge {
    int32_t triangleA;
    int32_t triangleB;
    int32_t vertexA;
    int32_t vertexB;
} MD5RSilhouetteEdge;
#pragma pack(pop)

typedef struct MD5RIndexedTriList {
    int32_t minVertex;
    int32_t numVertices;
    int32_t startIndex;      /* Index-element offset, not a byte offset. */
    int32_t primitiveCount;  /* Triangle count; consumes primitiveCount * 3 indices. */
} MD5RIndexedTriList;

typedef struct MD5RRange {
    int32_t first;
    int32_t count;
} MD5RRange;

typedef struct MD5RBufferPair {
    int32_t vertexBufferIndex;
    int32_t indexBufferIndex; /* ShadowVolumeBuffers uses -1 for no index buffer. */
} MD5RBufferPair;

typedef struct MD5RPrimitiveBatch {
    uint32_t transformCount;
    const int32_t *transformJointIndices;

    uint8_t hasSilTrace;
    uint8_t hasDraw;
    uint8_t hasShadowVerts;
    uint8_t hasSilhouetteEdges;

    MD5RIndexedTriList silTrace;
    MD5RIndexedTriList draw;
    int32_t shadowBaseVertex;
    MD5RRange silhouetteEdges;
} MD5RPrimitiveBatch;

typedef struct MD5RMesh {
    int32_t lodIndex;        /* -1 when LevelOfDetail is absent. */
    const char *material;

    uint8_t hasSilTraceBuffers;
    uint8_t hasDrawBuffers;
    uint8_t hasShadowVolumeBuffers;
    uint8_t hasBounds;

    MD5RBufferPair silTraceBuffers;
    MD5RBufferPair drawBuffers;
    MD5RBufferPair shadowVolumeBuffers;

    uint32_t batchCount;
    const MD5RPrimitiveBatch *batches;
    MD5RBounds bounds;

    uint32_t allocatorCommentBytes; /* Recomputed // N bytes annotation. */
} MD5RMesh;

typedef struct MD5RModel {
    uint32_t version;
    uint32_t allocatorMemSize;      /* MemSize; not file length. */

    uint32_t jointCount;
    const MD5RJoint *joints;

    uint32_t vertexBufferCount;
    const MD5RVertexBuffer *vertexBuffers;

    uint32_t indexBufferCount;
    const MD5RIndexBuffer *indexBuffers;

    uint32_t silhouetteEdgeCount;
    const MD5RSilhouetteEdge *silhouetteEdges;

    uint32_t lodCount;
    const float *lodDistances;

    uint32_t meshCount;
    const MD5RMesh *meshes;

    uint8_t hasBounds;
    uint8_t reserved[3];
    MD5RBounds bounds;
} MD5RModel;

#ifdef __cplusplus
static_assert(sizeof(MD5RSilhouetteEdge) == 16, "MD5R silhouette edge must be 16 bytes");
#else
_Static_assert(sizeof(MD5RSilhouetteEdge) == 16, "MD5R silhouette edge must be 16 bytes");
#endif

#ifdef __cplusplus
}
#endif

#endif /* WOLFENSTEIN_2009_MD5R_POD_H */

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.