feat: dump t6 materials as json

This commit is contained in:
Jan
2024-01-03 17:47:22 +01:00
parent 625ed0397f
commit df7b25b854
11 changed files with 1294 additions and 114 deletions

View File

@ -77,6 +77,7 @@ namespace IW4
"texcoord[7]",
};
static_assert(std::extent_v<decltype(materialStreamDestinationNames)> == STREAM_DST_COUNT);
static const char* materialStreamDestinationAbbreviation[]{
"p",
"n",
@ -106,6 +107,7 @@ namespace IW4
"normalTransform[1]",
};
static_assert(std::extent_v<decltype(materialStreamSourceNames)> == STREAM_SRC_COUNT);
static const char* materialStreamSourceAbbreviation[]{
"p",
"c",

View File

@ -0,0 +1,119 @@
#pragma once
#include "Game/T6/CommonT6.h"
#include "Game/T6/T6.h"
namespace T6
{
inline const char* textureSemanticNames[]{
"2D", "function", "colorMap", "unused1", "unused2", "normalMap", "unused3", "unused4", "specularMap", "unused5",
"occlusionMap", "unused6", "color0Map", "color1Map", "color2Map", "color3Map", "color4Map", "color5Map", "color6Map", "color7Map",
"color8Map", "color9Map", "color10Map", "color11Map", "color12Map", "color13Map", "color14Map", "color15Map", "throwMap",
};
static_assert(std::extent_v<decltype(textureSemanticNames)> == TS_COUNT);
inline const char* cameraRegionNames[]{
"litOpaque",
"litTrans",
"litQuasiOpaque",
"emissiveOpaque",
"emissiveTrans",
"emissiveFx",
"lightMapOpaque",
"depthHack",
"unused",
"sonar",
"none",
};
static_assert(std::extent_v<decltype(cameraRegionNames)> == CAMERA_REGION_NONE + 1);
static const char* textureFilterNames[]{
"disabled",
"nearest",
"linear",
"aniso2x",
"aniso4x",
"compare",
};
static_assert(std::extent_v<decltype(textureFilterNames)> == TEXTURE_FILTER_COUNT);
static const char* samplerStateMipMapNames[]{
"disabled",
"nearest",
"linear",
};
static_assert(std::extent_v<decltype(samplerStateMipMapNames)> == SAMPLER_MIPMAP_ENUM_COUNT);
static const char* gameFlagNames[]{
"1",
"2",
"NO_MARKS",
"8",
"10",
"20",
"CASTS_SHADOW",
"80",
"100",
"200",
"400",
"800",
"1000",
};
inline const char* blendNames[]{
"disabled",
"zero",
"one",
"srccolor",
"invsrccolor",
"srcalpha",
"invsrcalpha",
"destalpha",
"invdestalpha",
"destcolor",
"invdestcolor",
};
static_assert(std::extent_v<decltype(blendNames)> == GFXS_BLEND_COUNT);
inline const char* blendOpNames[]{
"disabled",
"add",
"subtract",
"revsubtract",
"min",
"max",
};
static_assert(std::extent_v<decltype(blendOpNames)> == GFXS_BLENDOP_COUNT);
inline const char* polygonOffsetNames[]{
"offset0",
"offset1",
"offset2",
"offsetShadowmap",
};
static_assert(std::extent_v<decltype(polygonOffsetNames)> == GFXS_POLYGON_OFFSET_COUNT);
inline const char* stencilOpNames[]{
"keep",
"zero",
"replace",
"incrsat",
"decrsat",
"invert",
"incr",
"decr",
};
static_assert(std::extent_v<decltype(stencilOpNames)> == GFXS_STENCILOP_COUNT);
inline const char* stencilFuncNames[]{
"never",
"less",
"equal",
"lessequal",
"greater",
"notequal",
"greaterequal",
"always",
};
static_assert(std::extent_v<decltype(stencilFuncNames)> == GFXS_STENCILFUNC_COUNT);
} // namespace T6

View File

@ -0,0 +1,101 @@
#pragma once
#include "Game/T6/CommonT6.h"
#include "Game/T6/T6.h"
namespace T6
{
inline const char* techniqueTypeNames[]{
"depth prepass",
"build shadowmap depth",
"unlit",
"emissive",
"lit",
"lit sun",
"lit sun shadow",
"lit spot",
"lit spot shadow",
"lit spot square",
"lit spot square shadow",
"lit spot round",
"lit spot round shadow",
"lit omni",
"lit omni shadow",
"lit dlight glight",
"lit sun dlight glight",
"lit sun shadow dlight glight",
"lit spot dlight glight",
"lit spot shadow dlight glight",
"lit spot square dlight glight",
"lit spot square shadow dlight glight",
"lit spot round dlight glight",
"lit spot round shadow dlight glight",
"lit omni dlight glight",
"lit omni shadow dlight glight",
"light spot",
"light omni",
"fakelight normal",
"fakelight view",
"sunlight preview",
"case texture",
"solid wireframe",
"shaded wireframe",
"debug bumpmap",
"debug performance",
};
static_assert(std::extent_v<decltype(techniqueTypeNames)> == TECHNIQUE_COUNT);
static const char* materialStreamDestinationNames[]{
"position", "normal", "color[0]", "color[1]", "depth", "texcoord[0]", "texcoord[1]",
"texcoord[2]", "texcoord[3]", "texcoord[4]", "texcoord[5]", "texcoord[6]", "texcoord[7]", "texcoord[8]",
"texcoord[9]", "texcoord[10]", "texcoord[11]", "texcoord[12]", "texcoord[13]", "blendWeight",
};
static_assert(std::extent_v<decltype(materialStreamDestinationNames)> == STREAM_DST_COUNT);
static const char* materialStreamDestinationAbbreviation[]{
"p", "n", "c0", "c1", "d", "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", "t10", "t11", "t12", "t13", "b",
};
static_assert(std::extent_v<decltype(materialStreamDestinationAbbreviation)> == STREAM_DST_COUNT);
static const char* materialStreamSourceNames[]{
"position",
"color",
"texcoord[0]",
"normal",
"tangent",
"texcoord[1]",
"texcoord[2]",
"texcoord[3]",
"normalTransform[0]",
"normalTransform[1]",
"blendWeight",
};
static_assert(std::extent_v<decltype(materialStreamSourceNames)> == STREAM_SRC_COUNT);
static const char* materialStreamSourceAbbreviation[]{
"p",
"c",
"t0",
"n",
"t",
"t1",
"t2",
"t3",
"n0",
"n1",
"b",
};
static_assert(std::extent_v<decltype(materialStreamSourceAbbreviation)> == STREAM_SRC_COUNT);
inline MaterialTypeInfo g_materialTypeInfo[]{
{"", "" },
{"m/", "m_" },
{"mc/", "mc_"},
{"?", "?" },
{"wc/", "wc_"},
{"?", "?" },
{"?", "?" },
{"?", "?" },
}; // TODO: Fill this
static_assert(std::extent_v<decltype(g_materialTypeInfo)> == MTL_TYPE_COUNT);
} // namespace T6