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

PredatorCZ / RevilLib / 159

16 Feb 2025 04:03PM UTC coverage: 11.245%. Remained the same
159

push

github

PredatorCZ
add mod xd3 sb4 vertex types

0 of 39 new or added lines in 1 file covered. (0.0%)

58 existing lines in 1 file now uncovered.

757 of 6732 relevant lines covered (11.24%)

6713.63 hits per line

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

0.7
/src/mtf_mod/common.cpp
1
/*  Revil Format Library
2
    Copyright(C) 2017-2021 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 "traits.hpp"
19
#include <set>
20

21
using namespace revil;
22

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

34
  uint32 add;
35
} ATTRADDCDX;
36

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

42
static AttributeUnormToSnorm NORMALCDX;
43

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

×
369
  revil::MODPrimitive retval;
×
370
  retval.lod1 = self.visibleLOD[0];
371
  retval.lod2 = self.visibleLOD[1];
×
372
  retval.lod3 = self.visibleLOD[2];
373
  retval.materialIndex = self.materialIndex;
×
374
  retval.triStrips = true;
×
375
  retval.groupId = self.unk;
×
376
  retval.meshId = 0;
377
  retval.vertexIndex = main.vertices.size();
×
378

379
  MODVertexSpan vtx;
380
  std::tie(vtx.attrs, vtx.codecs) =
×
381
      v0Maker(skinType, self.buffer1Stride != 8, main);
×
382
  vtx.numVertices = self.numVertices;
×
383
  vtx.buffer =
384
      main.vertexBuffer.data() + (self.vertexStart * self.buffer0Stride) +
×
385
      self.vertexStreamOffset + (self.indexValueOffset * self.buffer0Stride);
386
  vtx.stride = self.buffer0Stride;
387
  fd(vtx);
388
  for (auto &a : vtx.attrs) {
×
389
    a.offset = -1;
390
  }
391

392
  main.vertices.emplace_back(std::move(vtx));
×
393

394
  /*if (skin8 && self.buffer1Stride != 8) {
395
    throw std::runtime_error("Expected secondary buffer of 8 bytes!");
×
396
  }
397

×
398
  if (!skin8 && skinType && self.buffer1Stride) {
×
399
    throw std::runtime_error("Unexpected secondary buffer for skin!");
400
  }*/
×
401

402
  if (self.buffer1Stride) {
×
403
    MODVertexSpan vtx1;
×
404
    vtx1.attrs = v1Maker(skinType, self.buffer1Stride != 8);
405
    vtx1.numVertices = self.numVertices;
406
    vtx1.buffer = &main.vertexBuffer.back() - main.unkBufferSize + 1;
×
407
    vtx1.buffer += (self.vertexStart * self.buffer1Stride) +
408
                   self.vertexStream2Offset +
409
                   (self.indexValueOffset * self.buffer1Stride);
410
    vtx1.stride = self.buffer1Stride;
×
411
    fd(vtx1);
×
412
    for (auto &a : vtx1.attrs) {
413
      a.offset = -1;
414
    }
×
415

×
416
    main.vertices.emplace_back(std::move(vtx1));
417
  }
×
418

×
419
  uint16 *indexBuffer = main.indexBuffer.data() + self.indexStart;
420
  retval.indexIndex = main.indices.size();
×
421

422
  MODIndexSpan idArray(indexBuffer, self.numIndices);
×
423

×
424
  for (auto &idx : idArray) {
×
425
    if (idx != 0xffff) {
×
426
      idx -= self.vertexStart;
×
427
    }
×
428
  }
×
429

430
  main.indices.emplace_back(idArray);
×
431

×
432
  return retval;
×
433
};
×
434

435
revil::MODPrimitive MODMeshX70::ReflectLE(revil::MODImpl &main_) {
436
  auto &main = static_cast<MODInner<MODTraitsX170> &>(main_);
×
437
  return makeV1(*this, main, makeVertices0X170, makeVertices1X170,
×
438
                [&](MODVertexSpan &) {});
×
439
}
440

441
revil::MODPrimitive MODMeshX70::ReflectBE(revil::MODImpl &main_) {
×
442
  auto &main = static_cast<MODInner<MODTraitsX70> &>(main_);
443
  return makeV1(*this, main, makeVertices0X70, makeVertices1X70,
444
                [&](MODVertexSpan &d) { swapBuffers(d); });
445
}
×
446

447
revil::MODPrimitive MODMeshX99::ReflectLE(revil::MODImpl &main_) {
448
  auto &main = static_cast<MODInner<MODTraitsX99LE> &>(main_);
×
449
  auto retval = makeV1(*this, main, makeVertices0X99, makeVertices1X99,
450
                       [&](MODVertexSpan &) {});
×
451
  retval.skinIndex = skinInfo.boneRemapIndex;
×
452
  return retval;
453
}
454

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

×
463
struct MODAttributes {
464
  std::vector<Attribute> attrs;
×
465
  uint32 stride = 0;
466

467
  MODAttributes(std::initializer_list<Attribute> attrs_) : attrs(attrs_) {
468
    for (auto &d : attrs) {
469
      stride += fmtStrides[uint32(d.type)];
×
470
    }
471

472
    stride /= 8;
473
  }
474
};
×
475

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

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

2012
static const std::set<uint32> edgeModels{
2013
    0xdb7da014,
2014
    0xdb7da013,
2015
    0xdb7da00d,
2016
    // P3s_unk1s_B4c_W4c_N4c
2017
    0x0CB68015,
2018
    0x0CB68014,
2019
    0x0CB6800e,
2020
    // P3s_B1s_N4c
2021
    0xB0983013,
2022
    // P3s_unk1s_B8c_W8c_N4c
2023
    0xA320C015,
2024
    0xA320C016,
2025
    0xA320C00F,
2026
    0xB0983014,
2027
    0xB0983012,
2028
    0xB098300C,
2029
};
2030

2031
static const auto makeV2 = [](auto &self, revil::MODImpl &main, auto &&fd) {
2032
  revil::MODPrimitive retval;
2033
  uint8 visibleLOD_ = self.data0.template Get<MODMeshXC5::VisibleLOD>();
2034
  const auto visibleLOD = reinterpret_cast<es::Flags<uint8> &>(visibleLOD_);
2035
  retval.lod1 = visibleLOD[0];
2036
  retval.lod2 = visibleLOD[1];
2037
  retval.lod3 = visibleLOD[2];
2038
  retval.materialIndex = self.data0.template Get<MODMeshXC5::MaterialIndex>();
2039
  const MODMeshXC5::PrimitiveType_e primitiveType = MODMeshXC5::PrimitiveType_e(
2040
      self.data1.template Get<
2041
          typename std::decay_t<decltype(self)>::PrimitiveType>());
2042

2043
  retval.triStrips = primitiveType == MODMeshXC5::PrimitiveType_e::Strips;
2044
  retval.indexIndex = main.indices.size();
2045
  retval.vertexIndex = main.vertices.size();
2046
  retval.meshId = self.meshIndex;
2047
  retval.groupId = self.data0.template Get<MODMeshXC5::GroupID>();
2048
  const size_t vertexStride =
2049
      self.data1.template Get<MODMeshXC5::VertexBufferStride>();
2050

2051
  char *mainBuffer =
2052
      main.vertexBuffer.data() + (self.vertexStart * vertexStride) +
2053
      self.vertexStreamOffset + (self.indexValueOffset * vertexStride);
2054

2055
  auto foundFormat = formats.find(self.vertexFormat);
2056

2057
  if (!es::IsEnd(formats, foundFormat)) {
2058
    if (foundFormat->second.stride != vertexStride) {
2059
      foundFormat = fallbackFormats.find(self.vertexFormat);
2060
      if (es::IsEnd(fallbackFormats, foundFormat)) {
2061
        throw std::runtime_error("Cannot find fallback vertex format: " +
2062
                                 std::to_string(self.vertexFormat));
2063
      }
2064
    }
2065

2066
    MODVertexSpan tmpl;
2067
    tmpl.buffer = mainBuffer;
2068
    tmpl.attrs = foundFormat->second.attrs;
2069
    tmpl.stride = vertexStride;
2070
    tmpl.numVertices = self.numVertices;
2071
    fd(tmpl);
2072
    for (auto &a : tmpl.attrs) {
2073
      a.offset = -1;
2074
    }
2075

2076
    main.vertices.emplace_back(std::move(tmpl));
2077
  } else {
2078
    main.vertices.emplace_back();
2079

2080
    if (!edgeModels.contains(self.vertexFormat)) {
2081
      throw std::runtime_error("Unregistered vertex format: " +
2082
                               std::to_string(self.vertexFormat));
2083
    }
2084
  }
2085

2086
  uint16 *indexBuffer = main.indexBuffer.data() + self.indexStart;
2087

2088
  MODIndexSpan idArray(indexBuffer, self.numIndices);
2089

2090
  for (auto &idx : idArray) {
2091
    if (idx != 0xffff) {
2092
      idx -= self.vertexStart;
2093
    }
2094
  }
2095

2096
  main.indices.emplace_back(idArray);
2097

2098
  return retval;
2099
};
2100

2101
revil::MODPrimitive MODMeshXD2::ReflectLE(revil::MODImpl &main_) {
2102
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2103
  return makeV2(*this, main, [&](MODVertexSpan &d) {
2104
    for (auto &a : d.attrs) {
2105
      if (a.usage == AttributeType::BoneIndices && skinBoneBegin) {
2106
        auto mcdx = std::make_unique<AttributeAdd>();
2107
        mcdx->add = skinBoneBegin;
2108
      }
2109
    }
2110
  });
2111
}
2112

2113
revil::MODPrimitive MODMeshXD2::ReflectBE(revil::MODImpl &main_) {
2114
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2115
  return makeV2(*this, main, [&](MODVertexSpan &d) {
2116
    for (auto &a : d.attrs) {
2117
      if (a.usage == AttributeType::BoneIndices &&
2118
          skinBoneBegin < main.bones.size()) {
2119
        auto mcdx = std::make_unique<AttributeAdd>();
2120
        mcdx->add = skinBoneBegin;
2121
      }
2122
    }
2123

2124
    swapBuffers(d);
2125
  });
2126
}
2127

2128
revil::MODPrimitive MODMeshXD3PS4::ReflectLE(revil::MODImpl &main_) {
2129
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2130
  return makeV2(*this, main, [&](MODVertexSpan &d) {
2131
    for (auto &a : d.attrs) {
2132
      if (a.usage == AttributeType::BoneIndices && skinBoneBegin) {
2133
        auto mcdx = std::make_unique<AttributeAdd>();
2134
        mcdx->add = skinBoneBegin;
2135
      } else if (a.usage == AttributeType::Normal) {
2136
        a.format = VertexNormalSigned.format;
2137
        a.customCodec = nullptr;
2138
      } else if (a.usage == AttributeType::Tangent) {
2139
        a.format = VertexTangentSigned.format;
2140
        a.customCodec = nullptr;
2141
      }
2142
    }
2143
  });
2144
}
2145

2146
revil::MODPrimitive MODMeshXD3::ReflectLE(revil::MODImpl &main_) {
2147
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2148
  return makeV2(*this, main, [&](MODVertexSpan &d) {
2149
    for (auto &a : d.attrs) {
2150
      if (a.usage == AttributeType::BoneIndices && skinBoneBegin) {
2151
        auto mcdx = std::make_unique<AttributeAdd>();
2152
        mcdx->add = skinBoneBegin;
2153
      }
2154
    }
2155
  });
2156
}
2157

2158
revil::MODPrimitive MODMeshXC5::ReflectLE(revil::MODImpl &main_) {
2159
  auto &main = static_cast<MODInner<MODTraitsXC5> &>(main_);
2160
  return makeV2(*this, main, [&](MODVertexSpan &) {});
2161
}
2162

2163
revil::MODPrimitive MODMeshXC5::ReflectBE(revil::MODImpl &main_) {
2164
  auto &main = static_cast<MODInner<MODTraitsXC5> &>(main_);
2165
  return makeV2(*this, main, [&](MODVertexSpan &d) { swapBuffers(d); });
2166
}
2167

2168
revil::MODPrimitive MODMeshX06::ReflectLE(revil::MODImpl &main_) {
2169
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2170
  auto retval = makeV2(*this, main, [&](MODVertexSpan &) {});
2171
  retval.skinIndex = skinBoneBegin;
2172

2173
  /*auto idxArray = main.Indices()->At(retval.indexIndex);
2174
  std::span<const uint16> indices(
2175
      reinterpret_cast<const uint16 *>(idxArray->RawIndexBuffer()), numIndices);
2176

2177
  bool removeTS = true;
2178

2179
  for (auto d : vtArray.descs) {
2180
    switch (d->Usage()) {
2181
    case AttributeType::Normal: {
2182
      uni::FormatCodec::fvec sampled;
2183
      d->Codec().Sample(sampled, d->RawBuffer(), numVertices, d->Stride());
2184
      for (auto i : indices) {
2185
        if (i == 0xffff) {
2186
          continue;
2187
        }
2188

2189
        auto s = sampled.at(i);
2190
        if (s.Length() > 0.5f) {
2191
          removeTS = false;
2192
          //break;
2193
        } else {
2194
          printf("%i ", i);
2195
        }
2196
      }
2197

2198
      break;
2199
    }
2200

2201
    default:
2202
      break;
2203
    }
2204
  }
2205

2206
  if (removeTS) {
2207
    std::remove_if(vtArray.descs.storage.begin(), vtArray.descs.storage.end(,},
2208
                   [](MODVertexDescriptor &d) {
2209
                     return d.usage == MODVertexDescriptor::Usage_e::Normal;
2210
                   });
2211
    std::remove_if(vtArray.descs.storage.begin(), vtArray.descs.storage.end(,},
2212
                   [](MODVertexDescriptor &d) {
2213
                     return d.usage == MODVertexDescriptor::Usage_e::Tangent;
2214
                   });
2215
  }*/
2216

2217
  return retval;
2218
}
2219

2220
revil::MODPrimitive MODMeshXE5::ReflectBE(revil::MODImpl &main_) {
2221
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2222
  auto retval = makeV2(*this, main, [&](MODVertexSpan &d) { swapBuffers(d); });
2223
  retval.skinIndex = numEnvelopes;
2224

2225
  return retval;
2226
}
2227

2228
revil::MODPrimitive MODMeshXE5::ReflectLE(revil::MODImpl &main_) {
2229
  auto &main = static_cast<MODInner<MODTraitsXD2> &>(main_);
2230
  auto retval = makeV2(*this, main, [&](MODVertexSpan &) {});
2231
  retval.skinIndex = numEnvelopes;
2232

2233
  return retval;
2234
}
2235

2236
MOD::MOD() {}
2237
MOD::MOD(MOD &&) = default;
2238
MOD::~MOD() = default;
2239

2240
namespace revil {
2241
std::span<const MODVertexSpan> MOD::Vertices() const { return pi->vertices; }
2242
std::span<const MODIndexSpan> MOD::Indices() const { return pi->indices; }
2243
std::span<const revil::MODPrimitive> MOD::Primitives() const {
2244
  return pi->primitives;
2245
}
2246
std::span<const MODSkinJoints> MOD::SkinJoints() const { return pi->skins; }
2247
std::span<const MODMaterial> MOD::Materials() const { return pi->materialRefs; }
2248
std::span<const es::Matrix44> MOD::InverseBinds() const {
2249
  return pi->transforms;
2250
}
2251
std::span<const es::Matrix44> MOD::Transforms() const { return pi->refPoses; }
2252

2253
std::span<const MODBone> MOD::Bones() const { return pi->simpleBones; }
2254
std::span<const MODGroup> MOD::Groups() const { return pi->groups; }
2255
std::span<const MODEnvelope> MOD::Envelopes() const { return pi->envelopes; }
2256
const MODMetaData &MOD::Metadata() const { return pi->Metadata(); }
2257
} // 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

© 2025 Coveralls, Inc