• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PredatorCZ / RevilLib / 185

21 Apr 2026 07:59PM UTC coverage: 8.612% (-2.1%) from 10.756%
185

push

github

PredatorCZ
update sdl

3 of 459 new or added lines in 1 file covered. (0.65%)

2404 existing lines in 10 files now uncovered.

762 of 8848 relevant lines covered (8.61%)

4773.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.72
/src/mtf_mod/common.cpp
1
/*  Revil Format Library
2
    Copyright(C) 2017-2026 Lukas Cone
3

4
    This program is free software : you can redistribute it and / or modify
5
    it under the terms of the GNU General Public License as published by
6
    the Free Software Foundation, either version 3 of the License, or
7
    (at your option) any later version.
8

9
    This program is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
12
    GNU General Public License for more details.
13

14
    You should have received a copy of the GNU General Public License
15
    along with this program.If not, see <https://www.gnu.org/licenses/>.
16
*/
17

18
// #include "spike/master_printer.hpp"
19
#include "traits.hpp"
20
#include <set>
21

22
using namespace revil;
23

24
struct AttributeAdd : AttributeCodec {
×
25
  void Sample(uni::FormatCodec::fvec &, const char *, size_t) const override {}
×
26
  void Transform(uni::FormatCodec::fvec &in) const override {
×
27
    for (Vector4A16 &v : in) {
×
UNCOV
28
      v += add;
×
29
    }
30
  }
31
  bool CanSample() const override { return false; }
×
32
  bool CanTransform() const override { return true; }
×
UNCOV
33
  bool IsNormalized() const override { return false; }
×
34

35
  uint32 add;
36
} ATTRADDCDX;
37

38
using F = uni::FormatType;
39
using D = uni::DataType;
40
using U = AttributeType;
41
using V = Attribute;
42

43
static AttributeUnormToSnorm NORMALCDX;
44

45
static const Attribute VertexNormal{D::R8G8B8A8, F::UNORM, U::Normal, -1,
46
                                    &NORMALCDX};
47
static const Attribute VertexNormal3{D::R8G8B8, F::UNORM, U::Normal, -1,
48
                                     &NORMALCDX};
49
static const Attribute VertexTangent{D::R8G8B8A8, F::UNORM, U::Tangent, -1,
50
                                     &NORMALCDX};
51
static const Attribute VertexTangent3{D::R8G8B8, F::UNORM, U::Tangent, -1,
52
                                      &NORMALCDX};
53

54
struct AttributeTexCoordPhone : AttributeCodec {
55
  void Sample(uni::FormatCodec::fvec &, const char *, size_t) const override {}
×
56
  void Transform(uni::FormatCodec::fvec &in) const override {
×
UNCOV
57
    for (Vector4A16 &v : in) {
×
58
      v *= 64;
59
    }
60
  }
61
  bool CanSample() const override { return false; }
×
62
  bool CanTransform() const override { return true; }
×
UNCOV
63
  bool IsNormalized() const override { return false; }
×
64
} TXCRDPHONECDX;
65

66
static const Attribute TexCoordPhone{D::R16G16, F::UNORM, U::TextureCoordiante,
67
                                     -1, &TXCRDPHONECDX};
68

UNCOV
69
Attribute Packed(Attribute in) {
×
70
  in.offset = 1;
UNCOV
71
  return in;
×
72
}
73

74
static const Attribute TexCoord{D::R16G16, F::FLOAT, U::TextureCoordiante};
75

76
static const Attribute VertexQPosition{D::R16G16B16, F::NORM, U::Position};
77

78
static const Attribute VertexPosition{D::R32G32B32, F::FLOAT, U::Position};
79

80
static const Attribute VertexBoneIndices{D::R8G8B8A8, F::UINT, U::BoneIndices};
81

82
static const Attribute VertexColor{D::R8G8B8A8, F::UNORM, U::VertexColor};
83

84
static const Attribute VertexNormalSigned{D::R8G8B8A8, F::NORM, U::Normal};
85

86
static const Attribute VertexTangentSigned{D::R8G8B8A8, F::NORM, U::Tangent};
87

88
static constexpr uint32 fmtStrides[]{0,  128, 96, 64, 64, 48, 32, 32, 32,
89
                                     32, 32,  32, 24, 16, 16, 16, 16, 8};
90

91
static const auto swapBuffers = [](MODVertexSpan &spn) {
92
  const size_t numVertices = spn.numVertices;
×
UNCOV
93
  uint32 stride = spn.stride;
×
94
  uint32 curOffset = 0;
95

96
  for (auto &d : spn.attrs) {
×
97
    char *curBuffer = spn.buffer + curOffset;
×
UNCOV
98
    curOffset += fmtStrides[uint32(d.type)] / 8;
×
99

UNCOV
100
    switch (d.type) {
×
101
    case uni::DataType::R16: {
UNCOV
102
      for (size_t v = 0; v < numVertices; v++, curBuffer += stride) {
×
103
        FByteswapper(*reinterpret_cast<uint16 *>(curBuffer));
104
      }
105
      break;
106
    }
107

108
    case uni::DataType::R16G16: {
UNCOV
109
      for (size_t v = 0; v < numVertices; v++, curBuffer += stride) {
×
110
        FByteswapper(*reinterpret_cast<USVector2 *>(curBuffer));
111
      }
112
      break;
113
    }
114

115
    case uni::DataType::R16G16B16: {
UNCOV
116
      for (size_t v = 0; v < numVertices; v++, curBuffer += stride) {
×
117
        FByteswapper(*reinterpret_cast<USVector *>(curBuffer));
118
      }
119
      break;
120
    }
121

122
    case uni::DataType::R16G16B16A16: {
UNCOV
123
      for (size_t v = 0; v < numVertices; v++, curBuffer += stride) {
×
124
        FByteswapper(*reinterpret_cast<USVector4 *>(curBuffer));
125
      }
126
      break;
127
    }
128

129
    case uni::DataType::R32:
130
    case uni::DataType::R10G10B10A2: {
131
      for (size_t v = 0; v < numVertices; v++, curBuffer += stride) {
×
UNCOV
132
        FByteswapper(*reinterpret_cast<uint32 *>(curBuffer));
×
133
      }
134
      break;
135
    }
136

137
    case uni::DataType::R8G8B8A8:
×
138
      if (d.offset == 1) {
×
139
        for (size_t v = 0; v < numVertices; v++, curBuffer += stride) {
×
UNCOV
140
          FByteswapper(*reinterpret_cast<uint32 *>(curBuffer));
×
141
        }
142
      }
143
      break;
144

145
    case uni::DataType::R32G32: {
UNCOV
146
      for (size_t v = 0; v < numVertices; v++, curBuffer += stride) {
×
147
        FByteswapper(*reinterpret_cast<Vector2 *>(curBuffer));
148
      }
149
      break;
150
    }
151

152
    case uni::DataType::R32G32B32: {
UNCOV
153
      for (size_t v = 0; v < numVertices; v++, curBuffer += stride) {
×
154
        FByteswapper(*reinterpret_cast<Vector *>(curBuffer));
155
      }
156
      break;
157
    }
158

159
    default:
160
      break;
161
    }
162
  }
163
};
164

165
static const auto makeVertices0X70 = [](uint8 useSkin, bool v1stride4,
166
                                        auto &main) {
167
  std::vector<Attribute> attrs;
×
UNCOV
168
  std::vector<std::unique_ptr<AttributeCodec>> codecs;
×
169
  const bool skin8 = useSkin == 2;
170

171
  if (useSkin) {
×
UNCOV
172
    auto mcdx = std::make_unique<AttributeMad>();
×
173
    mcdx->mul = main.boundingBox.max - main.boundingBox.min;
174
    mcdx->add = main.boundingBox.min;
×
UNCOV
175
    attrs.emplace_back(
×
176
        Attribute{D::R16G16B16A16, F::UNORM, U::Position, -1, mcdx.get()});
UNCOV
177
    codecs.emplace_back(std::move(mcdx));
×
178

179
    if (skin8) {
×
180
      attrs.emplace_back(VertexBoneIndices);
×
181
      attrs.emplace_back(VertexBoneIndices);
×
182
      attrs.emplace_back(D::R8G8B8A8, F::UNORM, U::BoneWeights);
×
183
      attrs.emplace_back(D::R8G8B8A8, F::UNORM, U::BoneWeights);
×
184
      attrs.emplace_back(D::R10G10B10A2, F::NORM, U::Normal);
×
UNCOV
185
      attrs.emplace_back(TexCoord);
×
186
    } else {
187
      attrs.emplace_back(VertexBoneIndices);
×
188
      attrs.emplace_back(D::R8G8B8A8, F::UNORM, U::BoneWeights);
×
189
      attrs.emplace_back(D::R10G10B10A2, F::NORM, U::Normal);
×
190
      attrs.emplace_back(D::R10G10B10A2, F::NORM, U::Undefined); // tangent
×
UNCOV
191
      attrs.emplace_back(TexCoord);
×
192
    }
193
  } else {
194
    attrs.emplace_back(VertexPosition);
×
UNCOV
195
    attrs.emplace_back(Packed(VertexNormalSigned));
×
196

UNCOV
197
    if (v1stride4) {
×
198
      // attrs.emplace_back(Packed(VertexTangentSigned)); // tangent
199
      attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
200
      attrs.emplace_back(TexCoord);
×
UNCOV
201
      attrs.emplace_back(TexCoord);
×
202
      // null or swapped with tangent
UNCOV
203
      attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
204
    } else {
205
      // always null?
206
      attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
207
      attrs.emplace_back(TexCoord);
×
UNCOV
208
      attrs.emplace_back(TexCoord);
×
209
      // attrs.emplace_back(Packed(VertexTangentSigned));
UNCOV
210
      attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
211
    }
212
  }
213

UNCOV
214
  return std::make_pair(attrs, std::move(codecs));
×
215
};
216

217
static const auto makeVertices1X70 = [](uint8 useSkin, bool v1stride4) {
UNCOV
218
  std::vector<Attribute> attrs;
×
219
  const bool skin8 = useSkin == 2;
220

UNCOV
221
  if (skin8) {
×
222
    // attrs.emplace_back(D::R10G10B10A2, F::NORM, U::Tangent);
223
    attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
UNCOV
224
    attrs.emplace_back(TexCoord);
×
225
  } else {
UNCOV
226
    attrs.emplace_back(VertexColor);
×
227

228
    if (!v1stride4) {
×
UNCOV
229
      attrs.emplace_back(VertexColor);
×
230
    }
231
  }
UNCOV
232
  return attrs;
×
233
};
234

235
static const auto makeVertices0X99 = [](uint8 useSkin, bool v1stride4,
236
                                        auto &main) {
237
  std::vector<Attribute> attrs;
×
UNCOV
238
  std::vector<std::unique_ptr<AttributeCodec>> codecs;
×
239
  const bool skin8 = useSkin == 4;
240

241
  if (useSkin) {
×
UNCOV
242
    auto mcdx = std::make_unique<AttributeMad>();
×
243
    mcdx->mul = main.boundingBox.max - main.boundingBox.min;
244
    mcdx->add = main.boundingBox.min;
×
UNCOV
245
    attrs.emplace_back(
×
246
        Attribute{D::R16G16B16A16, F::NORM, U::Position, -1, mcdx.get()});
UNCOV
247
    codecs.emplace_back(std::move(mcdx));
×
248

249
    if (skin8) {
×
250
      attrs.emplace_back(VertexBoneIndices);
×
251
      attrs.emplace_back(VertexBoneIndices);
×
252
      attrs.emplace_back(D::R8G8B8A8, F::UNORM, U::BoneWeights);
×
253
      attrs.emplace_back(D::R8G8B8A8, F::UNORM, U::BoneWeights);
×
254
      attrs.emplace_back(VertexNormal);
×
UNCOV
255
      attrs.emplace_back(TexCoord);
×
256
    } else {
257
      attrs.emplace_back(VertexBoneIndices);
×
258
      attrs.emplace_back(D::R8G8B8A8, F::UNORM, U::BoneWeights);
×
UNCOV
259
      attrs.emplace_back(VertexNormal);
×
260
      // attrs.emplace_back(VertexTangent);
261
      attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
UNCOV
262
      attrs.emplace_back(TexCoord);
×
263
    }
264
  } else {
265
    attrs.emplace_back(VertexPosition);
×
UNCOV
266
    attrs.emplace_back(VertexNormal);
×
267

UNCOV
268
    if (v1stride4) {
×
269
      // attrs.emplace_back(VertexTangent);
270
      attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
271
      attrs.emplace_back(TexCoord);
×
UNCOV
272
      attrs.emplace_back(TexCoord);
×
273
      // null or swapped with tangent
UNCOV
274
      attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
275
    } else {
276
      // always null?
277
      attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
278
      attrs.emplace_back(TexCoord);
×
UNCOV
279
      attrs.emplace_back(TexCoord);
×
280
      // attrs.emplace_back(VertexTangent);
UNCOV
281
      attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
282
    }
283
  }
284

UNCOV
285
  return std::make_pair(attrs, std::move(codecs));
×
286
};
287

288
static const auto makeVertices1X99 = [](uint8 useSkin, bool v1stride4) {
289
  std::vector<Attribute> attrs;
×
UNCOV
290
  const bool skin8 = useSkin == 4;
×
291

292
  if (skin8) {
293
    // attrs.emplace_back(VertexTangent);
×
UNCOV
294
    attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
295
    attrs.emplace_back(TexCoord);
296
  } else {
×
UNCOV
297
    attrs.emplace_back(VertexColor);
×
298

UNCOV
299
    if (!v1stride4) {
×
300
      attrs.emplace_back(VertexColor);
301
    }
×
302
  }
×
303
  return attrs;
×
304
};
×
305

×
306
static const auto makeVertices0X170 = [](uint8 useSkin, bool, auto &main) {
×
UNCOV
307
  std::vector<Attribute> attrs;
×
308
  std::vector<std::unique_ptr<AttributeCodec>> codecs;
309
  const bool skin8 = useSkin == 2;
×
310

×
UNCOV
311
  if (useSkin) {
×
312
    auto mcdx = std::make_unique<AttributeMad>();
313
    mcdx->mul = main.boundingBox.max - main.boundingBox.min;
×
UNCOV
314
    mcdx->add = main.boundingBox.min;
×
315
    attrs.emplace_back(
316
        Attribute{D::R16G16B16A16, F::NORM, U::Position, -1, mcdx.get()});
317
    codecs.emplace_back(std::move(mcdx));
×
UNCOV
318

×
319
    if (skin8) {
UNCOV
320
      attrs.emplace_back(VertexBoneIndices);
×
321
      attrs.emplace_back(VertexBoneIndices);
322
      attrs.emplace_back(D::R8G8B8A8, F::UNORM, U::BoneWeights);
×
323
      attrs.emplace_back(D::R8G8B8A8, F::UNORM, U::BoneWeights);
×
UNCOV
324
      attrs.emplace_back(VertexNormal);
×
325
      attrs.emplace_back(TexCoord);
UNCOV
326
    } else {
×
327
      attrs.emplace_back(VertexBoneIndices);
328
      attrs.emplace_back(D::R8G8B8A8, F::UNORM, U::BoneWeights);
329
      attrs.emplace_back(D::R16G16B16A16, F::NORM, U::Normal);
×
330
      attrs.emplace_back(TexCoord);
×
UNCOV
331
    }
×
332
  } else {
UNCOV
333
    attrs.emplace_back(VertexPosition);
×
334
    attrs.emplace_back(D::R16G16B16A16, F::NORM, U::Normal);
335
    attrs.emplace_back(D::R32G32, F::FLOAT, U::TextureCoordiante);
336
  }
UNCOV
337

×
338
  return std::make_pair(attrs, std::move(codecs));
339
};
340

341
static const auto makeVertices1X170 = [](uint8 useSkin, bool) {
×
UNCOV
342
  std::vector<Attribute> attrs;
×
343
  const bool skin8 = useSkin == 2;
344

345
  if (useSkin) {
×
UNCOV
346
    // attrs.emplace_back(D::R16G16B16A16, F::NORM, U::Tangent);
×
347
    attrs.emplace_back(D::R32G32, F::UINT, U::Undefined);
348
    attrs.emplace_back(TexCoord);
×
UNCOV
349
  } else if (skin8) {
×
350
    // attrs.emplace_back(VertexTangent);
UNCOV
351
    attrs.emplace_back(D::R32, F::UINT, U::Undefined);
×
352
    attrs.emplace_back(TexCoord);
353
  } else {
×
354
    // attrs.emplace_back(D::R16G16B16A16, F::NORM, U::Tangent);
×
355
    attrs.emplace_back(D::R32G32, F::UINT, U::Undefined);
×
356
    attrs.emplace_back(D::R32G32, F::FLOAT, U::TextureCoordiante);
×
357
    attrs.emplace_back(VertexColor);
×
358
    attrs.emplace_back(VertexColor);
×
UNCOV
359
    attrs.emplace_back(VertexColor);
×
360
  }
361
  return attrs;
×
362
};
×
UNCOV
363

×
364
static const auto makeV1 = [](auto &self, auto &main, auto v0Maker,
365
                              auto v1Maker, auto &&fd) {
×
UNCOV
366
  auto &mat = main.materials[self.materialIndex].main;
×
367
  using material_type = typename std::remove_reference<decltype(mat)>::type;
368
  auto skinType = mat.vshData.template Get<typename material_type::SkinType>();
369

×
UNCOV
370
  revil::MODPrimitive retval;
×
371
  using F = revil::MODPrimitive::Flags;
UNCOV
372
  retval.flags.Set(F::Lod1, self.visibleLOD[0]);
×
373
  retval.flags.Set(F::Lod2, self.visibleLOD[1]);
374
  retval.flags.Set(F::Lod3, self.visibleLOD[2]);
×
375
  retval.flags.Set(F::Visible, self.visible);
×
UNCOV
376
  retval.flags.Set(F::Shape, self.shape);
×
377
  retval.flags.Set(F::Connective, self.connective);
UNCOV
378
  retval.flags = F::TriStrips;
×
379
  retval.materialIndex = self.materialIndex;
380
  retval.groupId = self.groupIndex;
381
  retval.meshId = 0;
×
382
  retval.vertexIndex = main.vertices.size();
×
UNCOV
383
  retval.alphaType = self.alphaType;
×
384

UNCOV
385
  MODVertexSpan vtx;
×
386
  std::tie(vtx.attrs, vtx.codecs) =
387
      v0Maker(skinType, self.buffer1Stride != 8, main);
388
  vtx.numVertices = self.numVertices;
UNCOV
389
  vtx.buffer =
×
390
      main.vertexBuffer.data() + (self.vertexStart * self.buffer0Stride) +
391
      self.vertexStreamOffset + (self.indexValueOffset * self.buffer0Stride);
392
  vtx.stride = self.buffer0Stride;
UNCOV
393
  fd(vtx);
×
394
  for (auto &a : vtx.attrs) {
395
    a.offset = -1;
UNCOV
396
  }
×
397

398
  main.vertices.emplace_back(std::move(vtx));
×
UNCOV
399

×
400
  /*if (skin8 && self.buffer1Stride != 8) {
UNCOV
401
    throw es::RuntimeError("Expected secondary buffer of 8 bytes!");
×
402
  }
403

×
UNCOV
404
  if (!skin8 && skinType && self.buffer1Stride) {
×
405
    throw es::RuntimeError("Unexpected secondary buffer for skin!");
406
  }*/
UNCOV
407

×
408
  if (self.buffer1Stride) {
409
    MODVertexSpan vtx1;
410
    vtx1.attrs = v1Maker(skinType, self.buffer1Stride != 8);
411
    vtx1.numVertices = self.numVertices;
×
UNCOV
412
    vtx1.buffer = &main.vertexBuffer.back() - main.unkBufferSize + 1;
×
413
    vtx1.buffer += (self.vertexStart * self.buffer1Stride) +
414
                   self.vertexStream2Offset +
415
                   (self.indexValueOffset * self.buffer1Stride);
×
UNCOV
416
    vtx1.stride = self.buffer1Stride;
×
417
    fd(vtx1);
418
    for (auto &a : vtx1.attrs) {
×
UNCOV
419
      a.offset = -1;
×
420
    }
UNCOV
421

×
422
    main.vertices.emplace_back(std::move(vtx1));
423
  }
×
424

×
425
  uint16 *indexBuffer = main.indexBuffer.data() + self.indexStart;
×
426
  retval.indexIndex = main.indices.size();
×
427

×
428
  MODIndexSpan idArray(indexBuffer, self.numIndices);
×
UNCOV
429

×
430
  for (auto &idx : idArray) {
431
    if (idx != 0xffff) {
×
432
      idx -= self.vertexStart;
×
433
    }
×
UNCOV
434
  }
×
435

436
  main.indices.emplace_back(idArray);
437

×
438
  return retval;
×
UNCOV
439
};
×
440

441
revil::MODPrimitive MODMeshX70::ReflectLE(revil::MODImpl &main_) {
UNCOV
442
  auto &main = static_cast<MODInner<MODTraitsX170> &>(main_);
×
443
  return makeV1(*this, main, makeVertices0X170, makeVertices1X170,
444
                [&](MODVertexSpan &) {});
445
}
UNCOV
446

×
447
revil::MODPrimitive MODMeshX70::ReflectBE(revil::MODImpl &main_) {
448
  auto &main = static_cast<MODInner<MODTraitsX70> &>(main_);
UNCOV
449
  return makeV1(*this, main, makeVertices0X70, makeVertices1X70,
×
450
                [&](MODVertexSpan &d) { swapBuffers(d); });
451
}
×
UNCOV
452

×
453
revil::MODPrimitive MODMeshX99::ReflectLE(revil::MODImpl &main_) {
454
  auto &main = static_cast<MODInner<MODTraitsX99LE> &>(main_);
455
  auto retval = makeV1(*this, main, makeVertices0X99, makeVertices1X99,
456
                       [&](MODVertexSpan &) {});
457
  retval.skinIndex = skinInfo.boneRemapIndex;
458
  return retval;
459
}
×
460

×
461
revil::MODPrimitive MODMeshX99::ReflectBE(revil::MODImpl &main_) {
×
462
  auto &main = static_cast<MODInner<MODTraitsX99BE> &>(main_);
×
UNCOV
463
  auto retval = makeV1(*this, main, makeVertices0X99, makeVertices1X99,
×
464
                       [&](MODVertexSpan &d) { swapBuffers(d); });
UNCOV
465
  retval.skinIndex = skinInfo.boneRemapIndex;
×
466
  return retval;
467
}
468

469
struct MODAttributes {
UNCOV
470
  std::vector<Attribute> attrs;
×
471
  uint32 stride = 0;
472

473
  MODAttributes(std::initializer_list<Attribute> attrs_) : attrs(attrs_) {
474
    for (auto &d : attrs) {
475
      stride += fmtStrides[uint32(d.type)];
476
    }
477

478
    stride /= 8;
479
  }
480
};
481

UNCOV
482
std::map<uint32, MODAttributes> fallbackFormats{
×
UNCOV
483
    {
×
484
        // xc3
×
485
        0xc31f2014, // P3s_W1s_N3c_B1c_T3c_B1c_U2h
×
486
        {
×
487
            VertexQPosition,
×
488
            V{D::R16, F::NORM, U::BoneWeights},
489
            VertexNormal3,
490
            V{D::R8, F::UINT, U::BoneIndices},
×
UNCOV
491
            VertexTangent3,
×
492
            V{D::R8, F::UINT, U::BoneIndices},
×
493
            TexCoord,
×
UNCOV
494
        },
×
UNCOV
495
    },
×
496
    {
×
497
        // xd2 be, this might be correct after all
UNCOV
498
        0xd8297028, // P3f_N4c_T4c_U2h
×
UNCOV
499
        {
×
500
            VertexPosition,
501
            VertexNormal,
UNCOV
502
            VertexTangent,
×
503
            TexCoord,
504
            VertexColor,
505
        },
506
    },
507
    {
508
        // xd3 be, sb4
509
        0xb6681034, // P3f_N4c_T4c_U2h_U2h_VC4c_U2h_unk
510
        {
511
            VertexPosition,
512
            VertexNormal,
×
513
            VertexTangent,
514
            TexCoord,
×
UNCOV
515
            TexCoord,
×
516
            VertexColor,
×
517
            TexCoord,
×
UNCOV
518
            V{D::R32, F::UINT, U::Undefined},
×
UNCOV
519
        },
×
520
    },
×
521
    {
UNCOV
522
        // xd3 be, sb4
×
523
        0x49b4f029, // P3f_N4c_T4c_U2h_VC4c_unk
×
524
        {
525
            VertexPosition,
526
            VertexNormal,
×
527
            VertexTangent,
528
            TexCoord,
529
            VertexColor,
×
530
            V{D::R32, F::UINT, U::Undefined},
×
531
        },
UNCOV
532
    },
×
533
    {
534
        // xd3 be, sb4
×
UNCOV
535
        0x926fd02e, // P3f_N4c_T4c_U2h_U2h_VC4c_VC4c_unk
×
536
        {
×
537
            VertexPosition,
538
            VertexNormal,
539
            VertexTangent,
540
            TexCoord,
×
541
            TexCoord,
UNCOV
542
            VertexColor,
×
543
            V{D::R32, F::UINT, U::Undefined},
544
        },
545
    },
546
    {
×
547
        // xd3 be, sb4
548
        0x9399c033, // P3f_N4c_T4c_U2h_U2h_VC4c_unk
549
        {
550
            VertexPosition,
551
            VertexNormal,
552
            VertexTangent,
553
            TexCoord,
554
            TexCoord,
555
            VertexColor,
556
            V{D::R32, F::UINT, U::Undefined},
557
        },
558
    },
×
559
    {
×
560
        // xd3 be, sb4
×
561
        0x5e7f202c, // P3f_N4c_T4c_U2h_U2h_unk
×
UNCOV
562
        {
×
563
            VertexPosition,
×
564
            VertexNormal,
565
            VertexTangent,
UNCOV
566
            TexCoord,
×
567
            TexCoord,
×
UNCOV
568
            V{D::R32, F::UINT, U::Undefined},
×
UNCOV
569
        },
×
UNCOV
570
    },
×
UNCOV
571
    {
×
UNCOV
572
        // xd3 be, sb4
×
573
        0x747d1031, // P3f_N4c_T4c_U2h_U2h_U2h_unk
UNCOV
574
        {
×
UNCOV
575
            VertexPosition,
×
576
            VertexNormal,
577
            VertexTangent,
UNCOV
578
            TexCoord,
×
579
            TexCoord,
580
            TexCoord,
581
            V{D::R32, F::UINT, U::Undefined},
582
        },
583
    },
584
};
585

586
std::map<uint32, MODAttributes> formats{
587
    {
588
        0x64593022, // P3s_W1s_N4c_T4c_B4c_U2h_W2h_unk_U2h_unk
×
589
        {
UNCOV
590
            VertexQPosition,
×
591
            V{D::R16, F::NORM, U::BoneWeights},
×
UNCOV
592
            VertexNormal,
×
UNCOV
593
            VertexTangent,
×
594
            VertexBoneIndices,
×
595
            TexCoord,
×
UNCOV
596
            V{D::R16G16, F::FLOAT, U::BoneWeights},
×
597
            V{D::R32, F::UINT, U::Undefined},
UNCOV
598
            TexCoord,
×
599
            V{D::R32, F::UINT, U::Undefined},
×
600
        },
601
    },
UNCOV
602
    {
×
603
        0x64593023, // P3s_W1s_N4c_T4c_B4c_U2h_W2h_unk_U2h_unk
604
        {
605
            VertexQPosition,
×
UNCOV
606
            V{D::R16, F::NORM, U::BoneWeights},
×
607
            VertexNormal,
UNCOV
608
            VertexTangent,
×
609
            VertexBoneIndices,
UNCOV
610
            TexCoord,
×
611
            V{D::R16G16, F::FLOAT, U::BoneWeights},
×
UNCOV
612
            V{D::R32, F::UINT, U::Undefined},
×
613
            TexCoord,
614
            V{D::R32, F::UINT, U::Undefined},
615
        },
616
    },
×
617
    {
618
        0x64593025, // P3s_W1s_N4c_T4c_B4c_U2h_W2h_unk_U2h_unk
×
619
        {
620
            VertexQPosition,
621
            V{D::R16, F::NORM, U::BoneWeights},
622
            VertexNormal,
×
623
            VertexTangent,
624
            VertexBoneIndices,
625
            TexCoord,
626
            V{D::R16G16, F::FLOAT, U::BoneWeights},
627
            V{D::R32, F::UINT, U::Undefined},
628
            TexCoord,
629
            V{D::R32, F::UINT, U::Undefined},
630
        },
631
    },
632
    {
633
        0x14d40020, // P3s_W1s_N4c_T4c_B4c_U2h_W2h
634
        {
×
635
            VertexQPosition,
×
UNCOV
636
            V{D::R16, F::NORM, U::BoneWeights},
×
UNCOV
637
            VertexNormal,
×
638
            VertexTangent,
×
UNCOV
639
            VertexBoneIndices,
×
640
            TexCoord,
641
            V{D::R16G16, F::FLOAT, U::BoneWeights},
UNCOV
642
        },
×
UNCOV
643
    },
×
UNCOV
644
    {
×
UNCOV
645
        0x14d40022, // P3s_W1s_N4c_T4c_B4c_U2h_W2h
×
UNCOV
646
        {
×
UNCOV
647
            VertexQPosition,
×
648
            V{D::R16, F::NORM, U::BoneWeights},
×
649
            VertexNormal,
650
            VertexTangent,
×
651
            VertexBoneIndices,
×
652
            TexCoord,
653
            V{D::R16G16, F::FLOAT, U::BoneWeights},
654
        },
×
655
    },
656
    {
657
        0x14d40019, // P3s_W1s_N4c_T4c_B4c_U2h_W2h
658
        {
659
            VertexQPosition,
660
            V{D::R16, F::NORM, U::BoneWeights},
661
            VertexNormal,
662
            VertexTangent,
663
            VertexBoneIndices,
UNCOV
664
            TexCoord,
×
665
            V{D::R16G16, F::FLOAT, U::BoneWeights},
666
        },
×
UNCOV
667
    },
×
668
    {
×
UNCOV
669
        0x14d4001f, // P3s_W1s_N4c_T4c_B4c_U2h_W2h
×
670
        {
×
671
            VertexQPosition,
×
672
            V{D::R16, F::NORM, U::BoneWeights},
×
673
            VertexNormal,
UNCOV
674
            VertexTangent,
×
UNCOV
675
            VertexBoneIndices,
×
676
            TexCoord,
677
            V{D::R16G16, F::FLOAT, U::BoneWeights},
678
        },
×
679
    },
680
    {
UNCOV
681
        0x14d40021, // P3s_W1s_N4c_T4c_B4c_U2h_W2h
×
682
        {
×
683
            VertexQPosition,
UNCOV
684
            V{D::R16, F::NORM, U::BoneWeights},
×
685
            VertexNormalSigned,
UNCOV
686
            VertexTangentSigned,
×
687
            VertexBoneIndices,
×
688
            TexCoord,
×
689
            V{D::R16G16, F::FLOAT, U::BoneWeights},
690
        },
691
    },
692
    {
×
693
        0xbde5301a, // P3s_W1s_N4c_T4c_B4c_U2h_W2h
694
        {
×
695
            VertexQPosition,
696
            V{D::R16, F::NORM, U::BoneWeights},
697
            VertexNormal,
698
            VertexTangent,
×
699
            VertexBoneIndices,
700
            TexCoord,
701
            V{D::R16G16, F::FLOAT, U::BoneWeights},
702
        },
703
    },
704
    {
705
        0xd86ca01c, // P3s_W1s_N4c_T4c_B4c_U2h_W2h_VC4c
706
        {
707
            VertexQPosition,
708
            V{D::R16, F::NORM, U::BoneWeights},
709
            VertexNormal,
UNCOV
710
            VertexTangent,
×
UNCOV
711
            VertexBoneIndices,
×
UNCOV
712
            TexCoord,
×
UNCOV
713
            V{D::R16G16, F::FLOAT, U::BoneWeights},
×
UNCOV
714
            VertexColor,
×
UNCOV
715
        },
×
716
    },
717
    {
UNCOV
718
        0x77d87021, // P3s_W1s_N4c_T4c_B4c_U2h_W2h_VC4c
×
719
        {
×
UNCOV
720
            VertexQPosition,
×
721
            V{D::R16, F::NORM, U::BoneWeights},
×
722
            VertexNormal,
×
723
            VertexTangent,
×
724
            VertexBoneIndices,
×
725
            TexCoord,
726
            V{D::R16G16, F::FLOAT, U::BoneWeights},
×
727
            VertexColor,
×
728
        },
729
    },
730
    {
×
731
        0x77d87024, // P3s_W1s_N4c_T4c_B4c_U2h_W2h_VC4c
732
        {
733
            VertexQPosition,
734
            V{D::R16, F::NORM, U::BoneWeights},
735
            VertexNormal,
736
            VertexTangent,
737
            VertexBoneIndices,
738
            TexCoord,
739
            V{D::R16G16, F::FLOAT, U::BoneWeights},
UNCOV
740
            VertexColor,
×
741
        },
742
    },
×
743
    {
×
UNCOV
744
        0x77d87022, // P3s_W1s_N4c_T4c_B4c_U2h_W2h_VC4c
×
UNCOV
745
        {
×
UNCOV
746
            VertexQPosition,
×
747
            V{D::R16, F::NORM, U::BoneWeights},
×
UNCOV
748
            VertexNormal,
×
749
            VertexTangent,
UNCOV
750
            VertexBoneIndices,
×
UNCOV
751
            TexCoord,
×
752
            V{D::R16G16, F::FLOAT, U::BoneWeights},
753
            VertexColor,
UNCOV
754
        },
×
755
    },
756
    {
UNCOV
757
        0x77d87023, // P3s_W1s_N4c_T4c_B4c_U2h_W2h_VC4c
×
758
        {
×
759
            VertexQPosition,
760
            V{D::R16, F::NORM, U::BoneWeights},
×
761
            VertexNormalSigned,
762
            VertexTangentSigned,
×
763
            VertexBoneIndices,
×
764
            TexCoord,
×
765
            V{D::R16G16, F::FLOAT, U::BoneWeights},
766
            VertexColor,
767
        },
768
    },
×
769
    {
770
        0x207d6036, // P3f_N4c_U2h_VC4c
×
771
        {
772
            VertexPosition,
773
            V{D::R32, F::UINT, U::Undefined}, // polar ts?
774
            TexCoord,
×
775
            VertexColor,
776
        },
777
    },
778
    {
779
        0x207d603b, // P3f_N4c_U2h_VC4c
780
        {
781
            VertexPosition,
782
            V{D::R32, F::UINT, U::Undefined}, // polar ts?
783
            TexCoord,
784
            VertexColor,
785
        },
UNCOV
786
    },
×
UNCOV
787
    {
×
UNCOV
788
        0x207d6037, // P3f_N4c_U2h_VC4c
×
UNCOV
789
        {
×
790
            VertexPosition,
×
UNCOV
791
            VertexNormal,
×
792
            TexCoord,
793
            VertexColor,
794
        },
×
795
    },
×
796
    {
×
797
        0x207d6030, // P3f_N4c_U2h_VC4c
×
798
        {
×
UNCOV
799
            VertexPosition,
×
800
            VertexNormal,
×
801
            TexCoord,
UNCOV
802
            VertexColor,
×
UNCOV
803
        },
×
804
    },
805
    {
UNCOV
806
        0x207d6038, // P3f_N4c_U2h_VC4c
×
807
        {
808
            VertexPosition,
809
            VertexNormalSigned,
810
            TexCoord,
811
            VertexColor,
812
        },
813
    },
814
    {
815
        0x2f55c03d, // P3s_W1s_N4c_T4c_B4c_U2h_W2h_unk36c
UNCOV
816
        {
×
817
            VertexQPosition,
818
            V{D::R16, F::NORM, U::BoneWeights},
×
UNCOV
819
            VertexNormal,
×
820
            VertexTangent,
×
UNCOV
821
            VertexBoneIndices,
×
UNCOV
822
            TexCoord,
×
823
            V{D::R16G16, F::FLOAT, U::BoneWeights},
×
UNCOV
824
            V{D::R32, F::UINT, U::Undefined},
×
825
            V{D::R32G32B32A32, F::UINT, U::Undefined},
826
            V{D::R32G32B32A32, F::UINT, U::Undefined},
×
UNCOV
827
        },
×
828
    },
829
    {
UNCOV
830
        0x49b4f028, // P3f_N4c_T4c_U2h_VC4c
×
831
        {
832
            VertexPosition,
UNCOV
833
            VertexNormal,
×
UNCOV
834
            VertexTangent,
×
835
            TexCoord,
UNCOV
836
            VertexColor,
×
837
        },
838
    },
×
839
    {
×
840
        0x49b4f02d, // P3f_N4c_T4c_U2h_VC4c
×
841
        {
842
            VertexPosition,
843
            VertexNormal,
UNCOV
844
            VertexTangent,
×
845
            TexCoord,
846
            VertexColor,
×
847
        },
848
    },
UNCOV
849
    {
×
850
        0x49b4f029, // P3f_N4c_T4c_U2h_VC4c
UNCOV
851
        {
×
UNCOV
852
            VertexPosition,
×
853
            VertexNormal,
854
            VertexTangent,
UNCOV
855
            TexCoord,
×
856
            VertexColor,
UNCOV
857
        },
×
UNCOV
858
    },
×
859
    {
860
        0x49b4f00e, // P3f_N4c_T4c_U2h_VC4c
UNCOV
861
        {
×
862
            VertexPosition,
UNCOV
863
            VertexNormalSigned,
×
UNCOV
864
            VertexTangentSigned,
×
UNCOV
865
            TexCoord,
×
UNCOV
866
            VertexColor,
×
867
        },
868
    },
UNCOV
869
    {
×
870
        0x49b4f022, // P3f_N4c_T4c_U2h_VC4c
UNCOV
871
        {
×
UNCOV
872
            VertexPosition,
×
UNCOV
873
            VertexNormal,
×
UNCOV
874
            VertexTangent,
×
875
            TexCoord,
876
            VertexColor,
877
        },
148✔
878
    },
879
    {
880
        0x49b4f02a, // P3f_N4c_T4c_U2h_VC4c
881
        {
149✔
882
            VertexPosition,
1,096✔
883
            VertexNormalSigned,
947✔
884
            VertexTangentSigned,
885
            TexCoord,
886
            VertexColor,
149✔
887
        },
149✔
888
    },
889
    {
890
        0x49b4f015, // P3f_N4c_T4c_U2h_VC4c
891
        {
892
            VertexPosition,
893
            VertexNormalSigned,
894
            VertexTangentSigned,
895
            TexCoord,
896
            VertexColor,
897
        },
898
    },
899
    {
900
        0x5e7f2025, // P3f_N4c_T4c_U2h_U2h
901
        {
902
            VertexPosition,
903
            VertexNormal,
904
            VertexTangent,
905
            TexCoord,
906
            TexCoord,
907
        },
908
    },
909
    {
910
        0x5e7f202c, // P3f_N4c_T4c_U2h_U2h
911
        {
912
            VertexPosition,
913
            VertexNormal,
914
            VertexTangent,
915
            TexCoord,
916
            TexCoord,
917
        },
918
    },
919
    {
920
        0x5e7f202d, // P3f_N4c_T4c_U2h_U2h
921
        {
922
            VertexPosition,
923
            VertexNormalSigned,
924
            VertexTangentSigned,
925
            TexCoord,
926
            TexCoord,
927
        },
928
    },
929
    {
930
        0x5e7f2030, // P3f_N4c_T4c_U2h_U2h
931
        {
932
            VertexPosition,
933
            VertexNormal,
934
            VertexTangent,
935
            TexCoord,
936
            TexCoord,
937
        },
938
    },
939
    {
940
        0x747d102a, // P3f_N4c_T4c_U2h_U2h_U2h
941
        {
942
            VertexPosition,
943
            VertexNormal,
944
            VertexTangent,
945
            TexCoord,
946
            TexCoord,
947
            TexCoord,
948
        },
949
    },
950
    {
951
        0x747d1031, // P3f_N4c_T4c_U2h_U2h_U2h
952
        {
953
            VertexPosition,
954
            VertexNormal,
955
            VertexTangent,
956
            TexCoord,
957
            TexCoord,
958
            TexCoord,
959
        },
960
    },
961
    {
962
        0x75c3e025, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c_U2h
963
        {
964
            VertexQPosition,
965
            V{D::R16, F::NORM, U::BoneWeights},
966
            VertexNormal,
967
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
968
            VertexBoneIndices,
969
            VertexBoneIndices,
970
            TexCoord,
971
            V{D::R16G16, F::FLOAT, U::BoneWeights},
972
            VertexTangent,
973
            TexCoord,
974
        },
975
    },
976
    {
977
        0x926fd027, // P3f_N4c_T4c_U2h_U2h_VC4c
978
        {
979
            VertexPosition,
980
            VertexNormal,
981
            VertexTangent,
982
            TexCoord,
983
            TexCoord,
984
            VertexColor,
985
        },
986
    },
987
    {
988
        0x926fd02d, // P3f_N4c_T4c_U2h_U2h_VC4c
989
        {
990
            VertexPosition,
991
            VertexNormal,
992
            VertexTangent,
993
            TexCoord,
994
            TexCoord,
995
            VertexColor,
996
        },
997
    },
998
    {
999
        0x926fd032, // P3f_N4c_T4c_U2h_U2h_VC4c
1000
        {
1001
            VertexPosition,
1002
            VertexNormal,
1003
            VertexTangent,
1004
            TexCoord,
1005
            TexCoord,
1006
            VertexColor,
1007
        },
1008
    },
1009
    {
1010
        0xb86de023, // P3f_N4c_T4c_U2h_U2h_VC4c
1011
        {
1012
            VertexPosition,
1013
            VertexNormal,
1014
            VertexTangent,
1015
            TexCoord,
1016
            TexCoord,
1017
        },
1018
    },
1019
    {
1020
        0x926fd02e, // P3f_N4c_T4c_U2h_U2h_VC4c
1021
        {
1022
            VertexPosition,
1023
            VertexNormal,
1024
            VertexTangent,
1025
            TexCoord,
1026
            TexCoord,
1027
            VertexColor,
1028
        },
1029
    },
1030
    {
1031
        0xb86de02a, // P3f_N4c_T4c_U2h_U2h_VC4c
1032
        {
1033
            VertexPosition,
1034
            VertexNormal,
1035
            VertexTangent,
1036
            TexCoord,
1037
            TexCoord,
1038
            VertexColor,
1039
        },
1040
    },
1041
    {
1042
        0xCBCF7026, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c_unk1i_U2h_unk1i
1043
        {
1044
            VertexQPosition,
1045
            V{D::R16, F::NORM, U::BoneWeights},
1046
            VertexNormal,
1047
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1048
            VertexBoneIndices,
1049
            VertexBoneIndices,
1050
            TexCoord,
1051
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1052
            VertexTangent,
1053
            V{D::R32, F::UINT, U::Undefined},
1054
            TexCoord,
1055
            V{D::R32, F::UINT, U::Undefined},
1056
        },
1057
    },
1058
    {
1059
        0xCBCF702A, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c_unk1i_U2h_unk1i
1060
        {
1061
            VertexQPosition,
1062
            V{D::R16, F::NORM, U::BoneWeights},
1063
            VertexNormal,
1064
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1065
            VertexBoneIndices,
1066
            VertexBoneIndices,
1067
            TexCoord,
1068
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1069
            VertexTangent,
1070
            V{D::R32, F::UINT, U::Undefined},
1071
            TexCoord,
1072
            V{D::R32, F::UINT, U::Undefined},
1073
        },
1074
    },
1075
    {
1076
        0xCBCF7027, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c_unk1i_U2h_unk1i
1077
        {
1078
            VertexQPosition,
1079
            V{D::R16, F::NORM, U::BoneWeights},
1080
            VertexNormal,
1081
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1082
            VertexBoneIndices,
1083
            VertexBoneIndices,
1084
            TexCoord,
1085
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1086
            VertexTangent,
1087
            V{D::R32, F::UINT, U::Undefined},
1088
            TexCoord,
1089
            V{D::R32, F::UINT, U::Undefined},
1090
        },
1091
    },
1092
    {
1093
        0xbb424023, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c
1094
        {
1095
            VertexQPosition,
1096
            V{D::R16, F::NORM, U::BoneWeights},
1097
            VertexNormal,
1098
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1099
            VertexBoneIndices,
1100
            VertexBoneIndices,
1101
            TexCoord,
1102
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1103
            VertexTangent,
1104
        },
1105
    },
1106
    {
1107
        0xbb424027, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c
1108
        {
1109
            VertexQPosition,
1110
            V{D::R16, F::NORM, U::BoneWeights},
1111
            VertexNormal,
1112
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1113
            VertexBoneIndices,
1114
            VertexBoneIndices,
1115
            TexCoord,
1116
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1117
            VertexTangent,
1118
        },
1119
    },
1120
    {
1121
        0xbb424024, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c
1122
        {
1123
            VertexQPosition,
1124
            V{D::R16, F::NORM, U::BoneWeights},
1125
            VertexNormal,
1126
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1127
            VertexBoneIndices,
1128
            VertexBoneIndices,
1129
            TexCoord,
1130
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1131
            VertexTangent,
1132
        },
1133
    },
1134
    {
1135
        0x1273701e, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c
1136
        {
1137
            VertexQPosition,
1138
            V{D::R16, F::NORM, U::BoneWeights},
1139
            VertexNormal,
1140
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1141
            VertexBoneIndices,
1142
            VertexBoneIndices,
1143
            TexCoord,
1144
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1145
            VertexTangent,
1146
        },
1147
    },
1148
    {
1149
        0xbb42401d, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c
1150
        {
1151
            VertexQPosition,
1152
            V{D::R16, F::NORM, U::BoneWeights},
1153
            VertexNormal,
1154
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1155
            VertexBoneIndices,
1156
            VertexBoneIndices,
1157
            TexCoord,
1158
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1159
            VertexTangent,
1160
        },
1161
    },
1162
    {
1163
        0xbb424025, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c
1164
        {
1165
            VertexQPosition,
1166
            V{D::R16, F::NORM, U::BoneWeights},
1167
            VertexNormalSigned,
1168
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1169
            VertexBoneIndices,
1170
            VertexBoneIndices,
1171
            TexCoord,
1172
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1173
            VertexTangentSigned,
1174
        },
1175
    },
1176
    {
1177
        0xb392101f, // P3s_W1s_N4c_T4c_B2h_U2h_U2h_unk2i
1178
        {
1179
            VertexQPosition,
1180
            V{D::R16, F::NORM, U::BoneWeights},
1181
            VertexNormal,
1182
            VertexTangent,
1183
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1184
            TexCoord,
1185
            TexCoord,
1186
            V{D::R32G32, F::UINT, U::Undefined},
1187
        },
1188
    },
1189
    {
1190
        0xb3921020, // P3s_W1s_N4c_T4c_B2h_U2h_U2h_unk2i
1191
        {
1192
            VertexQPosition,
1193
            V{D::R16, F::NORM, U::BoneWeights},
1194
            VertexNormal,
1195
            VertexTangent,
1196
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1197
            TexCoord,
1198
            TexCoord,
1199
            V{D::R32G32, F::UINT, U::Undefined},
1200
        },
1201
    },
1202
    {
1203
        0xda55a020, // P3s_W1s_N4c_T4c_B4c_U2h_W2s_U2h
1204
        {
1205
            VertexQPosition,
1206
            V{D::R16, F::NORM, U::BoneWeights},
1207
            VertexNormal,
1208
            VertexTangent,
1209
            VertexBoneIndices,
1210
            TexCoord,
1211
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1212
            TexCoord,
1213
        },
1214
    },
1215
    {
1216
        0xda55a021, // P3s_W1s_N4c_T4c_B4c_U2h_W2s_U2h
1217
        {
1218
            VertexQPosition,
1219
            V{D::R16, F::NORM, U::BoneWeights},
1220
            VertexNormal,
1221
            VertexTangent,
1222
            VertexBoneIndices,
1223
            TexCoord,
1224
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1225
            TexCoord,
1226
        },
1227
    },
1228
    {
1229
        0xda55a023, // P3s_W1s_N4c_T4c_B4c_U2h_W2s_U2h
1230
        {
1231
            VertexQPosition,
1232
            V{D::R16, F::NORM, U::BoneWeights},
1233
            VertexNormal,
1234
            VertexTangent,
1235
            VertexBoneIndices,
1236
            TexCoord,
1237
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1238
            TexCoord,
1239
        },
1240
    },
1241
    {
1242
        0xd9e801d, // P3s_W1s_N4c_T4c_U2h_B2h_U2h
1243
        {
1244
            VertexQPosition,
1245
            V{D::R16, F::NORM, U::BoneWeights},
1246
            VertexNormal,
1247
            VertexTangent,
1248
            TexCoord,
1249
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1250
            TexCoord,
1251
        },
1252
    },
1253
    {
1254
        0xd9e801e, // P3s_W1s_N4c_T4c_U2h_B2h_U2h
1255
        {
1256
            VertexQPosition,
1257
            V{D::R16, F::NORM, U::BoneWeights},
1258
            VertexNormal,
1259
            VertexTangent,
1260
            TexCoord,
1261
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1262
            TexCoord,
1263
        },
1264
    },
1265
    {
1266
        0xc31f201b, // P3s_W1s_N4c_T4c_U2h_B2h
1267
        {
1268
            VertexQPosition,
1269
            V{D::R16, F::NORM, U::BoneWeights},
1270
            VertexNormal,
1271
            VertexTangent,
1272
            TexCoord,
1273
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1274
        },
1275
    },
1276
    {
1277
        0xc31f201c, // P3s_W1s_N4c_T4c_U2h_B2h
1278
        {
1279
            VertexQPosition,
1280
            V{D::R16, F::NORM, U::BoneWeights},
1281
            VertexNormal,
1282
            VertexTangent,
1283
            TexCoord,
1284
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1285
        },
1286
    },
1287
    {
1288
        0x6a2e1016, // P3s_W1s_N4c_T4c_U2h_B2h
1289
        {
1290
            VertexQPosition,
1291
            V{D::R16, F::NORM, U::BoneWeights},
1292
            VertexNormal,
1293
            VertexTangent,
1294
            TexCoord,
1295
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1296
        },
1297
    },
1298
    {
1299
        0xc31f2014, // P3s_W1s_N4c_T4c_U2h_B2h
1300
        {
1301
            VertexQPosition,
1302
            V{D::R16, F::NORM, U::BoneWeights},
1303
            VertexNormal,
1304
            VertexTangent,
1305
            TexCoord,
1306
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1307
        },
1308
    },
1309
    {
1310
        0xc31f201d, // P3s_W1s_N4c_T4c_U2h_B2h
1311
        {
1312
            VertexQPosition,
1313
            V{D::R16, F::NORM, U::BoneWeights},
1314
            VertexNormalSigned,
1315
            VertexTangentSigned,
1316
            TexCoord,
1317
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1318
        },
1319
    },
1320
    {
1321
        0xa013501d, // P3s_W1s_N4c_T4c_U2h_B2h_VC4c
1322
        {
1323
            VertexQPosition,
1324
            V{D::R16, F::NORM, U::BoneWeights},
1325
            VertexNormal,
1326
            VertexTangent,
1327
            TexCoord,
1328
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1329
            VertexColor,
1330
        },
1331
    },
1332
    {
1333
        0xa013501e, // P3s_W1s_N4c_T4c_U2h_B2h_VC4c
1334
        {
1335
            VertexQPosition,
1336
            V{D::R16, F::NORM, U::BoneWeights},
1337
            VertexNormal,
1338
            VertexTangent,
1339
            TexCoord,
1340
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1341
            VertexColor,
1342
        },
1343
    },
1344
    {
1345
        0xa013501f, // P3s_W1s_N4c_T4c_U2h_B2h_VC4c
1346
        {
1347
            VertexQPosition,
1348
            V{D::R16, F::NORM, U::BoneWeights},
1349
            VertexNormalSigned,
1350
            VertexTangentSigned,
1351
            TexCoord,
1352
            V{D::R16G16, F::FLOAT, U::BoneIndices},
1353
            VertexColor,
1354
        },
1355
    },
1356
    {
1357
        0xd877801a, // P3s_B1s_N4c_T4c_U2h_unk1i_U2h_unk1i
1358
        {
1359
            VertexQPosition,
1360
            V{D::R16, F::UINT, U::BoneIndices},
1361
            VertexNormal,
1362
            VertexTangent,
1363
            TexCoord,
1364
            V{D::R32, F::UINT, U::Undefined},
1365
            TexCoord,
1366
            V{D::R32, F::UINT, U::Undefined},
1367
        },
1368
    },
1369
    {
1370
        0xd877801b, // P3s_B1s_N4c_T4c_U2h_unk1i_U2h_unk1i
1371
        {
1372
            VertexQPosition,
1373
            V{D::R16, F::UINT, U::BoneIndices},
1374
            VertexNormal,
1375
            VertexTangent,
1376
            TexCoord,
1377
            V{D::R32, F::UINT, U::Undefined},
1378
            TexCoord,
1379
            V{D::R32, F::UINT, U::Undefined},
1380
        },
1381
    },
1382
    {
1383
        0xcbf6c019, // P3s_unk1s_T4c_N4c_U2h_VC4c
1384
        {
1385
            VertexQPosition,
1386
            V{D::R16, F::UINT, U::Undefined}, // bone?
1387
            VertexNormal,
1388
            VertexTangent,
1389
            TexCoord,
1390
            VertexColor,
1391
        },
1392
    },
1393
    {
1394
        0xcbf6c01a, // P3s_unk1s_T4c_N4c_U2h_VC4c
1395
        {
1396
            VertexQPosition,
1397
            V{D::R16, F::UINT, U::Undefined}, // bone?
1398
            VertexTangent,
1399
            VertexNormal,
1400
            TexCoord,
1401
            VertexColor,
1402
        },
1403
    },
1404
    {
1405
        0xcbf6c01b, // P3s_unk1s_T4c_N4c_U2h_VC4c
1406
        {
1407
            VertexQPosition,
1408
            V{D::R16, F::UINT, U::Undefined}, // bone?
1409
            VertexTangentSigned,
1410
            VertexNormalSigned,
1411
            TexCoord,
1412
            VertexColor,
1413
        },
1414
    },
1415
    {
1416
        0xcbf6c00e, // P3s_unk1s_T4c_N4c_U2h_VC4c
1417
        {
1418
            VertexQPosition,
1419
            V{D::R16, F::UINT, U::Undefined},
1420
            VertexNormalSigned,
1421
            TexCoord,
1422
            TexCoord,
1423
            VertexColor,
1424
            VertexTangentSigned,
1425
        },
1426
    },
1427
    {
1428
        0x37a4e02e, // P3s_N4c_T4c_U2h_U2h_U2h_U2h
1429
        {
1430
            VertexPosition,
1431
            VertexNormal,
1432
            VertexTangent,
1433
            TexCoord,
1434
            TexCoord,
1435
            TexCoord,
1436
            TexCoord,
1437
        },
1438
    },
1439
    {
1440
        0x37a4e035, // P3s_N4c_T4c_U2h_U2h_U2h_U2h
1441
        {
1442
            VertexPosition,
1443
            VertexNormal,
1444
            VertexTangent,
1445
            TexCoord,
1446
            TexCoord,
1447
            TexCoord,
1448
            TexCoord,
1449
        },
1450
    },
1451
    {
1452
        0x12553032, // P3s_N4c_T4c_U2h_U2h_U2h
1453
        {
1454
            VertexPosition,
1455
            VertexNormal,
1456
            VertexTangent,
1457
            TexCoord,
1458
            TexCoord,
1459
            TexCoord,
1460
        },
1461
    },
1462
    {
1463
        0x1255302b, // P3s_N4c_T4c_U2h_U2h_U2h
1464
        {
1465
            VertexPosition,
1466
            VertexNormal,
1467
            VertexTangent,
1468
            TexCoord,
1469
            TexCoord,
1470
            TexCoord,
1471
        },
1472
    },
1473
    {
1474
        0xafa6302d, // P3f_N4c_T4c_U2h_U2h
1475
        {
1476
            VertexPosition,
1477
            VertexNormal,
1478
            VertexTangent,
1479
            TexCoord,
1480
            TexCoord,
1481
        },
1482
    },
1483
    {
1484
        0xafa63031, // P3f_N4c_T4c_U2h_U2h
1485
        {
1486
            VertexPosition,
1487
            VertexNormal,
1488
            VertexTangent,
1489
            TexCoord,
1490
            TexCoord,
1491
        },
1492
    },
1493
    {
1494
        0xd8297027, // P3f_N4c_T4c_U2h
1495
        {
1496
            VertexPosition,
1497
            VertexNormal,
1498
            VertexTangent,
1499
            TexCoord,
1500
        },
1501
    },
1502
    {
1503
        0xd829702c, // P3f_N4c_T4c_U2h
1504
        {
1505
            VertexPosition,
1506
            VertexNormal,
1507
            VertexTangent,
1508
            TexCoord,
1509
        },
1510
    },
1511
    {
1512
        0xd8297028, // P3f_N4c_T4c_U2h
1513
        {
1514
            VertexPosition,
1515
            VertexNormal,
1516
            VertexTangent,
1517
            TexCoord,
1518
        },
1519
    },
1520
    {
1521
        0xd8297021, // P3f_N4c_T4c_U2h
1522
        {
1523
            VertexPosition,
1524
            VertexNormal,
1525
            VertexTangent,
1526
            TexCoord,
1527
        },
1528
    },
1529
    {
1530
        0xd8297029, // P3f_N4c_T4c_U2h
1531
        {
1532
            VertexPosition,
1533
            VertexNormalSigned,
1534
            VertexTangentSigned,
1535
            TexCoord,
1536
        },
1537
    },
1538
    {
1539
        0x2082f034, // P3f_N4c_U2h_U2h_U2h
1540
        {
1541
            VertexPosition,
1542
            VertexNormal,
1543
            TexCoord,
1544
            TexCoord,
1545
            TexCoord,
1546
        },
1547
    },
1548
    {
1549
        0x2082f03b, // P3f_N4c_U2h_U2h_U2h
1550
        {
1551
            VertexPosition,
1552
            VertexNormal,
1553
            TexCoord,
1554
            TexCoord,
1555
            TexCoord,
1556
        },
1557
    },
1558
    {
1559
        0xc66fa03a, // P3f_N4c_U2h_U2h
1560
        {
1561
            VertexPosition,
1562
            VertexNormal,
1563
            TexCoord,
1564
            TexCoord,
1565
        },
1566
    },
1567
    {
1568
        0xc66fa03e, // P3f_N4c_U2h_U2h
1569
        {
1570
            VertexPosition,
1571
            VertexNormal,
1572
            TexCoord,
1573
            TexCoord,
1574
        },
1575
    },
1576
    {
1577
        0xd1a47031, // P3f_N4c_U2h_U2h
1578
        {
1579
            VertexPosition,
1580
            VertexNormal,
1581
            TexCoord,
1582
            TexCoord,
1583
        },
1584
    },
1585
    {
1586
        0xd1a47038, // P3f_N4c_U2h_U2h
1587
        {
1588
            VertexPosition,
1589
            VertexNormal,
1590
            TexCoord,
1591
            TexCoord,
1592
        },
1593
    },
1594
    {
1595
        0xd1a4703c, // P3f_N4c_U2h_U2h
1596
        {
1597
            VertexPosition,
1598
            VertexNormal,
1599
            TexCoord,
1600
            TexCoord,
1601
        },
1602
    },
1603
    {
1604
        0xa7d7d035, // P3f_N4c_U2h
1605
        {
1606
            VertexPosition,
1607
            V{D::R32, F::UINT, U::Undefined}, // polar ts?
1608
            TexCoord,
1609
        },
1610
    },
1611
    {
1612
        0xa7d7d036, // P3f_N4c_U2h
1613
        {
1614
            VertexPosition,
1615
            VertexNormal,
1616
            TexCoord,
1617
        },
1618
    },
1619
    {
1620
        0xa7d7d03a, // P3f_N4c_U2h
1621
        {
1622
            VertexPosition,
1623
            V{D::R32, F::UINT, U::Undefined}, // polar ts?
1624
            TexCoord,
1625
        },
1626
    },
1627
    {
1628
        0xa7d7d02f, // P3f_N4c_U2h
1629
        {
1630
            VertexPosition,
1631
            VertexNormal,
1632
            TexCoord,
1633
        },
1634
    },
1635
    {
1636
        0xa7d7d037, // P3f_N4c_U2h
1637
        {
1638
            VertexPosition,
1639
            VertexNormalSigned,
1640
            TexCoord,
1641
        },
1642
    },
1643
    {
1644
        0xa14e0035, // P3f_N4c_U2h_U2h_VC4c
1645
        {
1646
            VertexPosition,
1647
            VertexNormal,
1648
            TexCoord,
1649
            TexCoord,
1650
            VertexColor,
1651
        },
1652
    },
1653
    {
1654
        0xa14e003c, // P3f_N4c_U2h_U2h_VC4c
1655
        {
1656
            VertexPosition,
1657
            VertexNormal,
1658
            TexCoord,
1659
            TexCoord,
1660
            VertexColor,
1661
        },
1662
    },
1663
    {
1664
        0xa14e0040, // P3f_N4c_U2h_U2h_VC4c
1665
        {
1666
            VertexPosition,
1667
            VertexNormal,
1668
            TexCoord,
1669
            TexCoord,
1670
            VertexColor,
1671
        },
1672
    },
1673
    {
1674
        0x9399c02c, // P3f_N4c_T4c_U2h_U2h_VC4c
1675
        {
1676
            VertexPosition,
1677
            VertexNormal,
1678
            VertexTangent,
1679
            TexCoord,
1680
            TexCoord,
1681
            VertexColor,
1682
        },
1683
    },
1684
    {
1685
        0x9399c033, // P3f_N4c_T4c_U2h_U2h_VC4c
1686
        {
1687
            VertexPosition,
1688
            VertexNormal,
1689
            VertexTangent,
1690
            TexCoord,
1691
            TexCoord,
1692
            VertexColor,
1693
        },
1694
    },
1695
    {
1696
        0x9399c037, // P3f_N4c_T4c_U2h_U2h_VC4c
1697
        {
1698
            VertexPosition,
1699
            VertexNormal,
1700
            VertexTangent,
1701
            TexCoord,
1702
            TexCoord,
1703
            VertexColor,
1704
        },
1705
    },
1706
    {
1707
        0x4325a03e, // P3f_N4c_T4c_U2h_U2h_unk3h_unk1s_unki7
1708
        {
1709
            VertexPosition,
1710
            VertexNormal,
1711
            VertexTangent,
1712
            TexCoord,
1713
            TexCoord,
1714
            V{D::R32G32B32A32, F::UINT, U::Undefined},
1715
            V{D::R32G32B32A32, F::UINT, U::Undefined},
1716
            V{D::R32, F::UINT, U::Undefined},
1717
        },
1718
    },
1719
    {
1720
        0xb668102d, // P3f_N4c_T4c_U2h_U2h_VC4c_U2h
1721
        {
1722
            VertexPosition,
1723
            VertexNormal,
1724
            VertexTangent,
1725
            TexCoord,
1726
            TexCoord,
1727
            VertexColor,
1728
            TexCoord,
1729
        },
1730
    },
1731
    {
1732
        0xb6681034, // P3f_N4c_T4c_U2h_U2h_VC4c_U2h
1733
        {
1734
            VertexPosition,
1735
            VertexNormal,
1736
            VertexTangent,
1737
            TexCoord,
1738
            TexCoord,
1739
            VertexColor,
1740
            TexCoord,
1741
        },
1742
    },
1743
    {
1744
        0xb6681038, // P3f_N4c_T4c_U2h_U2h_VC4c_U2h
1745
        {
1746
            VertexPosition,
1747
            VertexNormal,
1748
            VertexTangent,
1749
            TexCoord,
1750
            TexCoord,
1751
            VertexColor,
1752
            TexCoord,
1753
        },
1754
    },
1755
    {
1756
        0x63b6c028, // P3f_N4c_T4c_U2h_U2h_U2h
1757
        {
1758
            VertexPosition,
1759
            VertexNormal,
1760
            VertexTangent,
1761
            TexCoord,
1762
            TexCoord,
1763
            TexCoord,
1764
        },
1765
    },
1766
    {
1767
        0x63b6c02f, // P3f_N4c_T4c_U2h_U2h_U2h_unk1i
1768
        {
1769
            VertexPosition,
1770
            VertexNormal,
1771
            VertexTangent,
1772
            TexCoord,
1773
            TexCoord,
1774
            TexCoord,
1775
            V{D::R32, F::UINT, U::Undefined},
1776
        },
1777
    },
1778
    {
1779
        0x63b6c033, // P3f_N4c_T4c_U2h_U2h_U2h_unk1i
1780
        {
1781
            VertexPosition,
1782
            VertexNormal,
1783
            VertexTangent,
1784
            TexCoord,
1785
            TexCoord,
1786
            TexCoord,
1787
            V{D::R32, F::UINT, U::Undefined},
1788
        },
1789
    },
1790
    {
1791
        0xa8fab017, // P3f_1s_N4c_T4c_U2h
1792
        {
1793
            VertexQPosition,
1794
            V{D::R16, F::UINT, U::BoneIndices},
1795
            VertexNormal,
1796
            VertexTangent,
1797
            TexCoord,
1798
        },
1799
    },
1800
    {
1801
        0xa8fab018, // P3f_1s_N4c_T4c_U2h
1802
        {
1803
            VertexQPosition,
1804
            V{D::R16, F::UINT, U::BoneIndices},
1805
            VertexNormal,
1806
            VertexTangent,
1807
            TexCoord,
1808
        },
1809
    },
1810
    {
1811
        0xa8fab010, // P3f_1s_N4c_T4c_U2h
1812
        {
1813
            VertexQPosition,
1814
            V{D::R16, F::UINT, U::BoneIndices},
1815
            VertexNormal,
1816
            VertexTangent,
1817
            TexCoord,
1818
        },
1819
    },
1820
    {
1821
        0xa8fab019, // P3f_1s_N4c_T4c_U2h
1822
        {
1823
            VertexQPosition,
1824
            V{D::R16, F::UINT, U::BoneIndices},
1825
            VertexNormalSigned,
1826
            VertexTangentSigned,
1827
            TexCoord,
1828
        },
1829
    },
1830
    {
1831
        0x1cb8011, // P3s_B1s_N4c_T4c_U2h
1832
        {
1833
            VertexQPosition,
1834
            V{D::R16, F::UINT, U::BoneIndices},
1835
            VertexNormal,
1836
            VertexTangent,
1837
            TexCoord,
1838
        },
1839
    },
1840
    {
1841
        0x1cb8011, // P3s_B1s_N4c_T4c_U2h_U2h
1842
        {
1843
            VertexQPosition,
1844
            V{D::R16, F::UINT, U::BoneIndices},
1845
            VertexNormal,
1846
            VertexTangent,
1847
            TexCoord,
1848
            TexCoord,
1849
        },
1850
    },
1851
    {
1852
        0xd84e3026, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c_VC4c
1853
        {
1854
            VertexQPosition,
1855
            V{D::R16, F::NORM, U::BoneWeights},
1856
            VertexNormal,
1857
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1858
            VertexBoneIndices,
1859
            VertexBoneIndices,
1860
            TexCoord,
1861
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1862
            VertexTangent,
1863
            VertexColor,
1864
        },
1865
    },
1866
    {
1867
        0xd84e3027, // P3s_W1s_N4c_W4c_B8c_U2h_W2h_T4c_VC4c
1868
        {
1869
            VertexQPosition,
1870
            V{D::R16, F::NORM, U::BoneWeights},
1871
            VertexNormalSigned,
1872
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1873
            VertexBoneIndices,
1874
            VertexBoneIndices,
1875
            TexCoord,
1876
            V{D::R16G16, F::FLOAT, U::BoneWeights},
1877
            VertexTangentSigned,
1878
            VertexColor,
1879
        },
1880
    },
1881
    {
1882
        0xa8fab009, // P3s_unk1s_N4c_B4c_U2s_T4c
1883
        {
1884
            VertexQPosition,
1885
            V{D::R16, F::UINT, U::Undefined},
1886
            VertexNormalSigned,
1887
            VertexBoneIndices,
1888
            TexCoordPhone,
1889
            VertexTangentSigned,
1890
        },
1891
    },
1892
    {
1893
        0xAE62600B, // P3s_unk1s_N4c_T4c_B4c_W4c_U2h
1894
        {
1895
            VertexQPosition,
1896
            V{D::R16, F::UINT, U::Undefined},
1897
            VertexNormalSigned,
1898
            VertexTangentSigned,
1899
            VertexBoneIndices,
1900
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
1901
            TexCoordPhone,
1902
        },
1903
    },
1904
    {
1905
        0x667B1018, // P3s_unk1s_N4c_VC4c_U2h_T4c
1906
        {
1907
            VertexQPosition,
1908
            V{D::R16, F::UINT, U::Undefined},
1909
            VertexNormal,
1910
            VertexColor,
1911
            TexCoord,
1912
            VertexTangent,
1913
        },
1914
    },
1915
    {
1916
        0x667B1019, // P3s_unk1s_N4c_VC4c_U2h_T4c
1917
        {
1918
            VertexQPosition,
1919
            V{D::R16, F::UINT, U::Undefined},
1920
            VertexNormal,
1921
            VertexColor,
1922
            TexCoord,
1923
            VertexTangent,
1924
        },
1925
    },
1926
    {
1927
        0xF606F017,
1928
        {
1929
            VertexPosition,
1930
            VertexNormalSigned,
1931
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
1932
            V{D::R8G8, F::UINT, U::BoneIndices},
1933
            V{D::R8G8, F::UNORM, U::BoneWeights},
1934
            VertexTangentSigned,
1935
            V{D::R8G8, F::UINT, U::BoneIndices},
1936
            V{D::R8G8, F::UNORM, U::BoneWeights},
1937
        },
1938
    },
1939
    {
1940
        0x01B36016,
1941
        {
1942
            VertexPosition,
1943
            VertexNormalSigned,
1944
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
1945
            V{D::R8G8, F::UINT, U::BoneIndices},
1946
            V{D::R8G8, F::UNORM, U::BoneWeights},
1947
            VertexTangentSigned, // always zero?
1948
            V{D::R8G8, F::UINT, U::BoneIndices},
1949
            V{D::R8G8, F::UNORM, U::BoneWeights},
1950
        },
1951
    },
1952
    {
1953
        0xD6784014,
1954
        {
1955
            VertexPosition,
1956
            VertexNormalSigned,
1957
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
1958
            V{D::R8G8, F::UINT, U::BoneIndices},
1959
            V{D::R8G8, F::UNORM, U::BoneWeights},
1960
        },
1961
    },
1962
    {
1963
        0x82917009,
1964
        {
1965
            VertexPosition,
1966
            VertexNormalSigned,
1967
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
1968
        },
1969
    },
1970
    {
1971
        0x59DC400B,
1972
        {
1973
            VertexPosition,
1974
            VertexNormalSigned,
1975
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
1976
            VertexTangentSigned,
1977
        },
1978
    },
1979
    {
1980
        0x43FB3015,
1981
        {
1982
            VertexPosition,
1983
            VertexNormalSigned,
1984
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
1985
            V{D::R8G8, F::UINT, U::BoneIndices},
1986
            V{D::R8G8, F::UNORM, U::BoneWeights},
1987
            VertexTangentSigned,
1988
        },
1989
    },
1990
    {
1991
        0x7BA7401B,
1992
        {
1993
            VertexPosition,
1994
            VertexNormalSigned,
1995
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
1996
            V{D::R8G8, F::UINT, U::BoneIndices},
1997
            V{D::R8G8, F::UNORM, U::BoneWeights},
1998
            VertexColor,
1999
        },
2000
    },
2001
    {
2002
        0xAE252019,
2003
        {
2004
            VertexPosition,
2005
            VertexNormalSigned,
2006
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
2007
            V{D::R8G8, F::UINT, U::BoneIndices},
2008
            V{D::R8G8, F::UNORM, U::BoneWeights},
2009
            VertexTangentSigned,
2010
            V{D::R8G8, F::UINT, U::BoneIndices},
2011
            V{D::R8G8, F::UNORM, U::BoneWeights},
2012
            V{D::R8G8, F::UINT, U::BoneIndices},
2013
            V{D::R8G8, F::UNORM, U::BoneWeights},
2014
            V{D::R8G8, F::UINT, U::BoneIndices},
2015
            V{D::R8G8, F::UNORM, U::BoneWeights},
2016
        },
2017
    },
2018
    {
2019
        0x3D62B012,
2020
        {
2021
            VertexPosition,
2022
            VertexNormalSigned,
2023
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
2024
            VertexColor,
2025
            VertexTangentSigned, // always zero?
2026
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
2027
        },
2028
    },
2029
    {
2030
        0x6180300A,
2031
        {
2032
            VertexPosition,
2033
            VertexNormalSigned,
2034
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
2035
            VertexColor,
2036
            VertexTangentSigned,
2037
        },
2038
    },
2039
    {
2040
        0x3F78800C,
2041
        {
2042
            VertexPosition,
2043
            VertexNormalSigned,
2044
            V{D::R32G32, F::FLOAT, U::TextureCoordiante},
2045
            VertexColor,
2046
            VertexTangentSigned,
2047
        },
2048
    },
2049
    {
2050
        0xEDF6F03C,
2051
        {
2052
            VertexPosition,
2053
            VertexNormal,
2054
            VertexTangent,
2055
            VertexBoneIndices,
2056
            V{D::R8G8B8A8, F::UNORM, U::BoneWeights},
2057
            TexCoord,
2058
        },
2059
    },
2060
    {
2061
        0x3339D03A,
2062
        {
2063
            VertexPosition,
2064
            VertexNormal3,
2065
            V{D::R8, F::UINT, U::BoneIndices},
2066
            TexCoord,
2067
        },
2068
    },
2069
    {
2070
        0xFD35504D,
2071
        {
2072
            VertexPosition,
2073
            VertexNormal,
2074
            Packed(VertexColor),
2075
            TexCoord,
2076
            TexCoord,
2077
        },
2078
    },
2079
    {
2080
        0x682EF04C,
2081
        {
2082
            VertexPosition,
2083
            VertexNormal,
2084
            Packed(VertexColor),
2085
            TexCoord,
2086
        },
2087
    },
2088
    {
2089
        0x707FB01C,
2090
        {
2091
            VertexQPosition,
2092
            V{D::R16, F::UINT, U::Undefined}, // bone id?
2093
            VertexNormal,
2094
            VertexTangent,
2095
            TexCoord,
2096
            V{D::R32, F::UINT, U::Undefined},
2097
            V{D::R32, F::UINT, U::Undefined},
2098
            TexCoord,
2099
            VertexColor,
2100
        },
2101
    },
2102
    {
2103
        0xCC510026,
2104
        {
2105
            VertexQPosition,
2106
            V{D::R16, F::NORM, U::BoneWeights},
2107
            VertexNormal,
2108
            VertexTangent,
2109
            VertexBoneIndices,
2110
            TexCoord,
2111
            V{D::R16G16, F::FLOAT, U::BoneWeights},
2112
            V{D::R32, F::UINT, U::Undefined},
2113
            V{D::R32, F::UINT, U::Undefined},
2114
            TexCoord,
2115
            V{D::R32, F::UINT, U::Undefined},
2116
        },
2117
    },
2118
    {
2119
        0x1B9A2021,
2120
        {
2121
            VertexQPosition,
2122
            V{D::R16, F::NORM, U::BoneWeights},
2123
            VertexNormal,
2124
            VertexTangent,
2125
            V{D::R16G16, F::FLOAT, U::BoneIndices},
2126
            TexCoord,
2127
            V{D::R32, F::UINT, U::Undefined},
2128
            V{D::R32, F::UINT, U::Undefined},
2129
            TexCoord,
2130
            V{D::R32, F::UINT, U::Undefined},
2131
        },
2132
    },
2133
    {
2134
        0xC9CFC012, // P3s_B1s_N4c_T4c_U2h_U2h
2135
        {
2136
            VertexQPosition,
2137
            V{D::R16, F::UINT, U::BoneIndices},
2138
            VertexNormal,
2139
            VertexTangent,
2140
            TexCoord,
2141
            TexCoord,
2142
        },
2143
    },
2144
    {
2145
        0xD4504024,
2146
        {
2147
            VertexPosition,
2148
            VertexNormal,
2149
            VertexTangent,
2150
            TexCoord,
2151
            TexCoord,
2152
        },
2153
    },
2154
    {
2155
        0x8A618032,
2156
        {
2157
            VertexPosition,
2158
            VertexNormal,
2159
            TexCoord,
2160
            TexCoord,
2161
        },
2162
    },
2163
    {
2164
        0x64421013,
2165
        {
2166
            VertexQPosition,
2167
            V{D::R16, F::UINT, U::BoneIndices},
2168
            VertexNormal,
2169
            VertexTangent,
2170
            TexCoord,
2171
            VertexColor,
2172
        },
2173
    },
2174
    {
2175
        0x0FA78018,
2176
        {
2177
            VertexQPosition,
2178
            V{D::R16, F::NORM, U::BoneWeights},
2179
            VertexNormal,
2180
            VertexColor,
2181
            TexCoord,
2182
            V{D::R16G16, F::FLOAT, U::BoneIndices},
2183
            VertexColor,
2184
        },
2185
    },
2186
};
2187

2188
static const std::set<uint32> edgeModels{
2189
    0xdb7da014,
2190
    0xdb7da013,
2191
    0xdb7da00d,
2192
    // P3s_unk1s_B4c_W4c_N4c
2193
    0x0CB68015,
2194
    0x0CB68014,
2195
    0x0CB6800e,
2196
    // P3s_B1s_N4c
2197
    0xB0983013,
2198
    // P3s_unk1s_B8c_W8c_N4c
2199
    0xA320C015,
2200
    0xA320C016,
2201
    0xA320C00F,
2202
    0xB0983014,
2203
    0xB0983012,
2204
    0xB098300C,
2205
};
2206

2207
static const auto makeV2 = [](auto &self, revil::MODImpl &main, auto &&fd) {
2208
  revil::MODPrimitive retval;
2209
  uint8 visibleLOD_ = self.data0.template Get<MODMeshXC5::VisibleLOD>();
2210
  const auto visibleLOD = reinterpret_cast<es::Flags<uint8> &>(visibleLOD_);
2211
  using F = revil::MODPrimitive::Flags;
2212
  retval.flags.Set(F::Lod1, visibleLOD[0]);
2213
  retval.flags.Set(F::Lod2, visibleLOD[1]);
2214
  retval.flags.Set(F::Lod3, visibleLOD[2]);
2215
  retval.flags.Set(F::Visible, self.data1.template Get<MODMeshXC5::Visible>());
2216
  retval.flags.Set(F::Shape, self.data1.template Get<MODMeshXC5::Shape>());
2217
  retval.flags.Set(F::Bridge, self.data1.template Get<MODMeshXC5::Bridge>());
2218
  retval.flags.Set(F::Sort, self.data1.template Get<MODMeshXC5::Sort>());
2219
  retval.flags.Set(F::BinormalFlip,
2220
                   self.data1.template Get<MODMeshXC5::BinormalFlip>());
2221
  retval.materialIndex = self.data0.template Get<MODMeshXC5::MaterialIndex>();
2222
  retval.layout = self.vertexFormat;
2223
  const MODMeshXC5::PrimitiveType_e primitiveType = MODMeshXC5::PrimitiveType_e(
2224
      self.data1.template Get<MODMeshXC5::PrimitiveType>());
2225
  retval.alphaType = self.data1.template Get<MODMeshXC5::AlphaType>();
2226
  retval.flags.Set(F::TriStrips,
2227
                   primitiveType == MODMeshXC5::PrimitiveType_e::Strips);
2228
  retval.drawMode = self.drawMode;
2229
  retval.indexIndex = main.indices.size();
2230
  retval.vertexIndex = main.vertices.size();
2231
  retval.meshId = self.meshIndex;
2232
  retval.groupId = self.data0.template Get<MODMeshXC5::GroupID>();
2233
  const size_t vertexStride =
2234
      self.data1.template Get<MODMeshXC5::VertexBufferStride>();
2235

2236
  char *mainBuffer =
2237
      main.vertexBuffer.data() + (self.vertexStart * vertexStride) +
2238
      self.vertexStreamOffset + (self.indexValueOffset * vertexStride);
2239

2240
  auto foundFormat = formats.find(self.vertexFormat);
2241

2242
  if (!es::IsEnd(formats, foundFormat)) {
2243
    if (foundFormat->second.stride != vertexStride) {
2244
      foundFormat = fallbackFormats.find(self.vertexFormat);
2245
      if (es::IsEnd(fallbackFormats, foundFormat)) {
2246
        throw std::runtime_error("Cannot find fallback vertex format: " +
2247
                                 std::to_string(self.vertexFormat));
2248
      }
2249
    }
2250

2251
    MODVertexSpan tmpl;
2252
    tmpl.buffer = mainBuffer;
2253
    tmpl.attrs = foundFormat->second.attrs;
2254
    tmpl.stride = vertexStride;
2255
    tmpl.numVertices = self.numVertices;
2256
    fd(tmpl);
2257
    for (auto &a : tmpl.attrs) {
2258
      a.offset = -1;
2259
    }
2260

2261
    main.vertices.emplace_back(std::move(tmpl));
2262
  } else {
2263
    main.vertices.emplace_back();
2264

2265
    if (!edgeModels.contains(self.vertexFormat)) {
2266
      throw std::runtime_error("Unregistered vertex format: " +
2267
                               std::to_string(self.vertexFormat));
2268
      // PrintError("Unregistered vertex format: ", std::hex,
2269
      // self.vertexFormat);
2270
    }
2271
  }
2272

2273
  uint16 *indexBuffer = main.indexBuffer.data() + self.indexStart;
2274

2275
  MODIndexSpan idArray(indexBuffer, self.numIndices);
2276

2277
  for (auto &idx : idArray) {
2278
    if (idx != 0xffff) {
2279
      idx -= self.vertexStart;
2280
    }
2281
  }
2282

2283
  main.indices.emplace_back(idArray);
2284

2285
  return retval;
2286
};
2287

2288
revil::MODPrimitive MODMeshXD2::ReflectLE(revil::MODImpl &main_) {
2289
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2290
  return makeV2(*this, main, [&](MODVertexSpan &d) {
2291
    for (auto &a : d.attrs) {
2292
      if (a.usage == AttributeType::BoneIndices && skinBoneBegin) {
2293
        auto mcdx = std::make_unique<AttributeAdd>();
2294
        mcdx->add = skinBoneBegin;
2295
      }
2296
    }
2297
  });
2298
}
2299

2300
revil::MODPrimitive MODMeshXD2::ReflectBE(revil::MODImpl &main_) {
2301
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2302
  return makeV2(*this, main, [&](MODVertexSpan &d) {
2303
    for (auto &a : d.attrs) {
2304
      if (a.usage == AttributeType::BoneIndices &&
2305
          skinBoneBegin < main.bones.size()) {
2306
        auto mcdx = std::make_unique<AttributeAdd>();
2307
        mcdx->add = skinBoneBegin;
2308
      }
2309
    }
2310

2311
    swapBuffers(d);
2312
  });
2313
}
2314

2315
revil::MODPrimitive MODMeshXD3PS4::ReflectLE(revil::MODImpl &main_) {
2316
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2317
  return makeV2(*this, main, [&](MODVertexSpan &d) {
2318
    for (auto &a : d.attrs) {
2319
      if (a.usage == AttributeType::BoneIndices && skinBoneBegin) {
2320
        auto mcdx = std::make_unique<AttributeAdd>();
2321
        mcdx->add = skinBoneBegin;
2322
      } else if (a.usage == AttributeType::Normal) {
2323
        a.format = VertexNormalSigned.format;
2324
        a.customCodec = nullptr;
2325
      } else if (a.usage == AttributeType::Tangent) {
2326
        a.format = VertexTangentSigned.format;
2327
        a.customCodec = nullptr;
2328
      }
2329
    }
2330
  });
2331
}
2332

2333
revil::MODPrimitive MODMeshXD3::ReflectLE(revil::MODImpl &main_) {
2334
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2335
  return makeV2(*this, main, [&](MODVertexSpan &d) {
2336
    for (auto &a : d.attrs) {
2337
      if (a.usage == AttributeType::BoneIndices && skinBoneBegin) {
2338
        auto mcdx = std::make_unique<AttributeAdd>();
2339
        mcdx->add = skinBoneBegin;
2340
      }
2341
    }
2342
  });
2343
}
2344

2345
revil::MODPrimitive MODMeshXC5::ReflectLE(revil::MODImpl &main_) {
2346
  auto &main = static_cast<MODInner<MODTraitsXC5> &>(main_);
2347
  return makeV2(*this, main, [&](MODVertexSpan &) {});
2348
}
2349

2350
revil::MODPrimitive MODMeshXC5::ReflectBE(revil::MODImpl &main_) {
2351
  auto &main = static_cast<MODInner<MODTraitsXC5> &>(main_);
2352
  return makeV2(*this, main, [&](MODVertexSpan &d) { swapBuffers(d); });
2353
}
2354

2355
revil::MODPrimitive MODMeshX06::ReflectLE(revil::MODImpl &main_) {
2356
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2357
  auto retval = makeV2(*this, main, [&](MODVertexSpan &) {});
2358
  retval.skinIndex = skinBoneBegin;
2359

2360
  /*auto idxArray = main.Indices()->At(retval.indexIndex);
2361
  std::span<const uint16> indices(
2362
      reinterpret_cast<const uint16 *>(idxArray->RawIndexBuffer()), numIndices);
2363

2364
  bool removeTS = true;
2365

2366
  for (auto d : vtArray.descs) {
2367
    switch (d->Usage()) {
2368
    case AttributeType::Normal: {
2369
      uni::FormatCodec::fvec sampled;
2370
      d->Codec().Sample(sampled, d->RawBuffer(), numVertices, d->Stride());
2371
      for (auto i : indices) {
2372
        if (i == 0xffff) {
2373
          continue;
2374
        }
2375

2376
        auto s = sampled.at(i);
2377
        if (s.Length() > 0.5f) {
2378
          removeTS = false;
2379
          //break;
2380
        } else {
2381
          printf("%i ", i);
2382
        }
2383
      }
2384

2385
      break;
2386
    }
2387

2388
    default:
2389
      break;
2390
    }
2391
  }
2392

2393
  if (removeTS) {
2394
    std::remove_if(vtArray.descs.storage.begin(), vtArray.descs.storage.end(,},
2395
                   [](MODVertexDescriptor &d) {
2396
                     return d.usage == MODVertexDescriptor::Usage_e::Normal;
2397
                   });
2398
    std::remove_if(vtArray.descs.storage.begin(), vtArray.descs.storage.end(,},
2399
                   [](MODVertexDescriptor &d) {
2400
                     return d.usage == MODVertexDescriptor::Usage_e::Tangent;
2401
                   });
2402
  }*/
2403

2404
  return retval;
2405
}
2406

2407
revil::MODPrimitive MODMeshXE5::ReflectBE(revil::MODImpl &main_) {
2408
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2409
  auto retval = makeV2(*this, main, [&](MODVertexSpan &d) { swapBuffers(d); });
2410
  retval.skinIndex = numEnvelopes;
2411

2412
  return retval;
2413
}
2414

2415
revil::MODPrimitive MODMeshXE5::ReflectLE(revil::MODImpl &main_) {
2416
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2417
  auto retval = makeV2(*this, main, [&](MODVertexSpan &) {});
2418
  retval.skinIndex = numEnvelopes;
2419

2420
  return retval;
2421
}
2422

2423
MOD::MOD() {}
2424
MOD::MOD(MOD &&) = default;
2425
MOD::~MOD() = default;
2426

2427
namespace revil {
2428
std::span<const MODVertexSpan> MOD::Vertices() const { return pi->vertices; }
2429
std::span<const MODIndexSpan> MOD::Indices() const { return pi->indices; }
2430
std::span<const revil::MODPrimitive> MOD::Primitives() const {
2431
  return pi->primitives;
2432
}
2433
std::span<const MODSkinJoints> MOD::SkinJoints() const { return pi->skins; }
2434
std::span<const MODMaterial *> MOD::Materials() const {
2435
  return std::span(const_cast<const MODMaterial **>(pi->materialRefs.data()),
2436
                   pi->materialRefs.size());
2437
}
2438
std::span<const es::Matrix44> MOD::InverseBinds() const {
2439
  return pi->transforms;
2440
}
2441
std::span<const es::Matrix44> MOD::Transforms() const { return pi->refPoses; }
2442

2443
std::span<const MODBone> MOD::Bones() const { return pi->simpleBones; }
2444
std::span<const MODGroup> MOD::Groups() const { return pi->groups; }
2445
std::span<const MODEnvelope> MOD::Envelopes() const { return pi->envelopes; }
2446
const MODMetaData &MOD::Metadata() const { return pi->Metadata(); }
2447
const std::vector<std::string> &MOD::Textures() const { return pi->paths; }
2448
} // namespace revil
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc