mirror of https://github.com/AxioDL/metaforce.git
Initial MP2 fixes
This commit is contained in:
parent
6ddbd15cfc
commit
25842949a9
|
@ -521,8 +521,11 @@ void FinishBlenderMesh(hecl::blender::PyOutStream& os, unsigned matSetCount, int
|
||||||
" use_vert_dict = vert_dict[0]\n"
|
" use_vert_dict = vert_dict[0]\n"
|
||||||
" merge_verts = [use_vert_dict[fv[od_entry['bm'].verts.layers.int['CMDLOriginalPosIdxs']]] for fv in "
|
" merge_verts = [use_vert_dict[fv[od_entry['bm'].verts.layers.int['CMDLOriginalPosIdxs']]] for fv in "
|
||||||
"face.verts]\n"
|
"face.verts]\n"
|
||||||
|
" try:\n"
|
||||||
" if bm.faces.get(merge_verts) is not None:\n"
|
" if bm.faces.get(merge_verts) is not None:\n"
|
||||||
" continue\n"
|
" continue\n"
|
||||||
|
" except:\n"
|
||||||
|
" continue\n"
|
||||||
" merge_face = bm.faces.new(merge_verts)\n"
|
" merge_face = bm.faces.new(merge_verts)\n"
|
||||||
" for i in range(len(face.loops)):\n"
|
" for i in range(len(face.loops)):\n"
|
||||||
" old = face.loops[i]\n"
|
" old = face.loops[i]\n"
|
||||||
|
|
|
@ -34,8 +34,7 @@ void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t
|
||||||
else
|
else
|
||||||
texLabel = "Texture";
|
texLabel = "Texture";
|
||||||
|
|
||||||
out.format(fmt(
|
out.format(fmt("# Texture\n"
|
||||||
"# Texture\n"
|
|
||||||
"tex_node = new_nodetree.nodes.new('ShaderNodeTexImage')\n"
|
"tex_node = new_nodetree.nodes.new('ShaderNodeTexImage')\n"
|
||||||
"tex_node.label = '{} {}'\n"
|
"tex_node.label = '{} {}'\n"
|
||||||
"texture_nodes.append(tex_node)\n"),
|
"texture_nodes.append(tex_node)\n"),
|
||||||
|
@ -52,8 +51,7 @@ void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t
|
||||||
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['Normal'], tex_node.inputs['Vector']))\n";
|
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['Normal'], tex_node.inputs['Vector']))\n";
|
||||||
else if (type >= GX::TG_TEX0 && type <= GX::TG_TEX7) {
|
else if (type >= GX::TG_TEX0 && type <= GX::TG_TEX7) {
|
||||||
uint8_t texIdx = type - GX::TG_TEX0;
|
uint8_t texIdx = type - GX::TG_TEX0;
|
||||||
out.format(fmt(
|
out.format(fmt("tex_uv_node = new_nodetree.nodes.new('ShaderNodeUVMap')\n"
|
||||||
"tex_uv_node = new_nodetree.nodes.new('ShaderNodeUVMap')\n"
|
|
||||||
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['UV'], tex_node.inputs['Vector']))\n"
|
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['UV'], tex_node.inputs['Vector']))\n"
|
||||||
"tex_uv_node.uv_map = 'UV_{}'\n"),
|
"tex_uv_node.uv_map = 'UV_{}'\n"),
|
||||||
texIdx);
|
texIdx);
|
||||||
|
@ -72,8 +70,7 @@ void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t
|
||||||
void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx, const float* vals) {
|
void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx, const float* vals) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case UVAnimation::Mode::MvInvNoTranslation:
|
case UVAnimation::Mode::MvInvNoTranslation:
|
||||||
out.format(fmt(
|
out.format(fmt("for link in list(tex_links):\n"
|
||||||
"for link in list(tex_links):\n"
|
|
||||||
" if link.from_node.label == 'MTX_{}':\n"
|
" if link.from_node.label == 'MTX_{}':\n"
|
||||||
" tex_links.remove(link)\n"
|
" tex_links.remove(link)\n"
|
||||||
" soc_from = link.from_socket\n"
|
" soc_from = link.from_socket\n"
|
||||||
|
@ -88,8 +85,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
|
||||||
idx);
|
idx);
|
||||||
break;
|
break;
|
||||||
case UVAnimation::Mode::MvInv:
|
case UVAnimation::Mode::MvInv:
|
||||||
out.format(fmt(
|
out.format(fmt("for link in list(tex_links):\n"
|
||||||
"for link in list(tex_links):\n"
|
|
||||||
" if link.from_node.label == 'MTX_{}':\n"
|
" if link.from_node.label == 'MTX_{}':\n"
|
||||||
" tex_links.remove(link)\n"
|
" tex_links.remove(link)\n"
|
||||||
" soc_from = link.from_socket\n"
|
" soc_from = link.from_socket\n"
|
||||||
|
@ -104,8 +100,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
|
||||||
idx);
|
idx);
|
||||||
break;
|
break;
|
||||||
case UVAnimation::Mode::Scroll:
|
case UVAnimation::Mode::Scroll:
|
||||||
out.format(fmt(
|
out.format(fmt("for link in list(tex_links):\n"
|
||||||
"for link in list(tex_links):\n"
|
|
||||||
" if link.from_node.label == 'MTX_{}':\n"
|
" if link.from_node.label == 'MTX_{}':\n"
|
||||||
" tex_links.remove(link)\n"
|
" tex_links.remove(link)\n"
|
||||||
" soc_from = link.from_socket\n"
|
" soc_from = link.from_socket\n"
|
||||||
|
@ -122,8 +117,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
|
||||||
idx, vals[0], vals[1], vals[2], vals[3]);
|
idx, vals[0], vals[1], vals[2], vals[3]);
|
||||||
break;
|
break;
|
||||||
case UVAnimation::Mode::Rotation:
|
case UVAnimation::Mode::Rotation:
|
||||||
out.format(fmt(
|
out.format(fmt("for link in list(tex_links):\n"
|
||||||
"for link in list(tex_links):\n"
|
|
||||||
" if link.from_node.label == 'MTX_{}':\n"
|
" if link.from_node.label == 'MTX_{}':\n"
|
||||||
" tex_links.remove(link)\n"
|
" tex_links.remove(link)\n"
|
||||||
" soc_from = link.from_socket\n"
|
" soc_from = link.from_socket\n"
|
||||||
|
@ -140,8 +134,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
|
||||||
idx, vals[0], vals[1]);
|
idx, vals[0], vals[1]);
|
||||||
break;
|
break;
|
||||||
case UVAnimation::Mode::HStrip:
|
case UVAnimation::Mode::HStrip:
|
||||||
out.format(fmt(
|
out.format(fmt("for link in list(tex_links):\n"
|
||||||
"for link in list(tex_links):\n"
|
|
||||||
" if link.from_node.label == 'MTX_{}':\n"
|
" if link.from_node.label == 'MTX_{}':\n"
|
||||||
" tex_links.remove(link)\n"
|
" tex_links.remove(link)\n"
|
||||||
" soc_from = link.from_socket\n"
|
" soc_from = link.from_socket\n"
|
||||||
|
@ -160,8 +153,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
|
||||||
idx, vals[0], vals[1], vals[2], vals[3]);
|
idx, vals[0], vals[1], vals[2], vals[3]);
|
||||||
break;
|
break;
|
||||||
case UVAnimation::Mode::VStrip:
|
case UVAnimation::Mode::VStrip:
|
||||||
out.format(fmt(
|
out.format(fmt("for link in list(tex_links):\n"
|
||||||
"for link in list(tex_links):\n"
|
|
||||||
" if link.from_node.label == 'MTX_{}':\n"
|
" if link.from_node.label == 'MTX_{}':\n"
|
||||||
" tex_links.remove(link)\n"
|
" tex_links.remove(link)\n"
|
||||||
" soc_from = link.from_socket\n"
|
" soc_from = link.from_socket\n"
|
||||||
|
@ -180,8 +172,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
|
||||||
idx, vals[0], vals[1], vals[2], vals[3]);
|
idx, vals[0], vals[1], vals[2], vals[3]);
|
||||||
break;
|
break;
|
||||||
case UVAnimation::Mode::Model:
|
case UVAnimation::Mode::Model:
|
||||||
out.format(fmt(
|
out.format(fmt("for link in list(tex_links):\n"
|
||||||
"for link in list(tex_links):\n"
|
|
||||||
" if link.from_node.label == 'MTX_{}':\n"
|
" if link.from_node.label == 'MTX_{}':\n"
|
||||||
" tex_links.remove(link)\n"
|
" tex_links.remove(link)\n"
|
||||||
" soc_from = link.from_socket\n"
|
" soc_from = link.from_socket\n"
|
||||||
|
@ -196,8 +187,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
|
||||||
idx);
|
idx);
|
||||||
break;
|
break;
|
||||||
case UVAnimation::Mode::CylinderEnvironment:
|
case UVAnimation::Mode::CylinderEnvironment:
|
||||||
out.format(fmt(
|
out.format(fmt("for link in list(tex_links):\n"
|
||||||
"for link in list(tex_links):\n"
|
|
||||||
" if link.from_node.label == 'MTX_{}':\n"
|
" if link.from_node.label == 'MTX_{}':\n"
|
||||||
" tex_links.remove(link)\n"
|
" tex_links.remove(link)\n"
|
||||||
" soc_from = link.from_socket\n"
|
" soc_from = link.from_socket\n"
|
||||||
|
@ -214,8 +204,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
|
||||||
idx, vals[0], vals[1]);
|
idx, vals[0], vals[1]);
|
||||||
break;
|
break;
|
||||||
case UVAnimation::Mode::Eight:
|
case UVAnimation::Mode::Eight:
|
||||||
out.format(fmt(
|
out.format(fmt("for link in list(tex_links):\n"
|
||||||
"for link in list(tex_links):\n"
|
|
||||||
" if link.from_node.label == 'MTX_{}':\n"
|
" if link.from_node.label == 'MTX_{}':\n"
|
||||||
" tex_links.remove(link)\n"
|
" tex_links.remove(link)\n"
|
||||||
" soc_from = link.from_socket\n"
|
" soc_from = link.from_socket\n"
|
||||||
|
@ -244,12 +233,12 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
|
||||||
}
|
}
|
||||||
|
|
||||||
void Material::AddKcolor(Stream& out, const GX::Color& col, unsigned idx) {
|
void Material::AddKcolor(Stream& out, const GX::Color& col, unsigned idx) {
|
||||||
out.format(fmt(
|
out.format(fmt("kcolors[{}] = ({}, {}, {}, {})\n"
|
||||||
"kcolors[{}] = ({}, {}, {}, {})\n"
|
|
||||||
"kalphas[{}] = {}\n"
|
"kalphas[{}] = {}\n"
|
||||||
"\n"),
|
"\n"),
|
||||||
idx, (float)col.color[0] / (float)0xff, (float)col.color[1] / (float)0xff, (float)col.color[2] / (float)0xff,
|
idx, (float)col.color[0] / (float)0xff, (float)col.color[1] / (float)0xff,
|
||||||
(float)col.color[3] / (float)0xff, idx, (float)col.color[3] / (float)0xff);
|
(float)col.color[2] / (float)0xff, (float)col.color[3] / (float)0xff, idx,
|
||||||
|
(float)col.color[3] / (float)0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class MAT>
|
template <class MAT>
|
||||||
|
@ -354,10 +343,9 @@ template <class MAT>
|
||||||
static void _DescribeTEV(const MAT& mat) {
|
static void _DescribeTEV(const MAT& mat) {
|
||||||
for (uint32_t i = 0; i < mat.tevStageCount; ++i) {
|
for (uint32_t i = 0; i < mat.tevStageCount; ++i) {
|
||||||
const auto& stage = mat.tevStages[i];
|
const auto& stage = mat.tevStages[i];
|
||||||
fmt::print(stderr, fmt("A:{} B:{} C:{} D:{} -> {} | A:{} B:{} C:{} D:{} -> {}\n"),
|
fmt::print(stderr, fmt("A:{} B:{} C:{} D:{} -> {} | A:{} B:{} C:{} D:{} -> {}\n"), ToString(stage.colorInA()),
|
||||||
ToString(stage.colorInA()), ToString(stage.colorInB()),
|
ToString(stage.colorInB()), ToString(stage.colorInC()), ToString(stage.colorInD()),
|
||||||
ToString(stage.colorInC()), ToString(stage.colorInD()), ToString(stage.colorOpOutReg()),
|
ToString(stage.colorOpOutReg()), ToString(stage.alphaInA()), ToString(stage.alphaInB()),
|
||||||
ToString(stage.alphaInA()), ToString(stage.alphaInB()),
|
|
||||||
ToString(stage.alphaInC()), ToString(stage.alphaInD()), ToString(stage.alphaOpOutReg()));
|
ToString(stage.alphaInC()), ToString(stage.alphaInD()), ToString(stage.alphaOpOutReg()));
|
||||||
}
|
}
|
||||||
bool hasInd = mat.flags.samusReflectionIndirectTexture();
|
bool hasInd = mat.flags.samusReflectionIndirectTexture();
|
||||||
|
@ -388,12 +376,10 @@ struct KColLink {
|
||||||
|
|
||||||
struct WhiteColorLink {
|
struct WhiteColorLink {
|
||||||
const char* shaderInput;
|
const char* shaderInput;
|
||||||
explicit WhiteColorLink(const char* shaderInput)
|
explicit WhiteColorLink(const char* shaderInput) : shaderInput(shaderInput) {}
|
||||||
: shaderInput(shaderInput) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void _GenerateRootShader(Stream& out, int) {
|
static void _GenerateRootShader(Stream& out, int) { /* End of shader links */
|
||||||
/* End of shader links */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Targs>
|
template <typename... Targs>
|
||||||
|
@ -401,8 +387,8 @@ static void _GenerateRootShader(Stream& out, int tidx, TexLink tex, Targs... arg
|
||||||
int texIdx = tex.texidx == -1 ? tidx : tex.texidx;
|
int texIdx = tex.texidx == -1 ? tidx : tex.texidx;
|
||||||
out << "texture_nodes[" << texIdx << "].name = '" << tex.shaderInput << "'\n";
|
out << "texture_nodes[" << texIdx << "].name = '" << tex.shaderInput << "'\n";
|
||||||
out << "texture_nodes[" << texIdx << "].label = '" << tex.shaderInput << "'\n";
|
out << "texture_nodes[" << texIdx << "].label = '" << tex.shaderInput << "'\n";
|
||||||
out << "new_nodetree.links.new(texture_nodes[" << texIdx << "].outputs['" <<
|
out << "new_nodetree.links.new(texture_nodes[" << texIdx << "].outputs['" << (tex.alpha ? "Alpha" : "Color")
|
||||||
(tex.alpha ? "Alpha" : "Color") << "'], node.inputs['" << tex.shaderInput << "'])\n";
|
<< "'], node.inputs['" << tex.shaderInput << "'])\n";
|
||||||
if (tex.texidx == -1)
|
if (tex.texidx == -1)
|
||||||
++tidx;
|
++tidx;
|
||||||
_GenerateRootShader(out, tidx, args...);
|
_GenerateRootShader(out, tidx, args...);
|
||||||
|
@ -422,8 +408,8 @@ static void _GenerateRootShader(Stream& out, int tidx, ExtendedSpecularLink tex,
|
||||||
|
|
||||||
template <typename... Targs>
|
template <typename... Targs>
|
||||||
static void _GenerateRootShader(Stream& out, int tidx, KColLink kcol, Targs... args) {
|
static void _GenerateRootShader(Stream& out, int tidx, KColLink kcol, Targs... args) {
|
||||||
out << "node.inputs['" << kcol.shaderInput << "'].default_value = " <<
|
out << "node.inputs['" << kcol.shaderInput << "'].default_value = " << (kcol.alpha ? "kalphas[" : "kcolors[")
|
||||||
(kcol.alpha ? "kalphas[" : "kcolors[") << kcol.kcidx << "]\n";
|
<< kcol.kcidx << "]\n";
|
||||||
_GenerateRootShader(out, tidx, args...);
|
_GenerateRootShader(out, tidx, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,7 +423,9 @@ template <typename... Targs>
|
||||||
static void _GenerateRootShader(Stream& out, const char* type, Targs... args) {
|
static void _GenerateRootShader(Stream& out, const char* type, Targs... args) {
|
||||||
out << "node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
|
out << "node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
|
||||||
"node.name = 'Output'\n"
|
"node.name = 'Output'\n"
|
||||||
"node.node_tree = bpy.data.node_groups['" << type << "']\n"
|
"node.node_tree = bpy.data.node_groups['"
|
||||||
|
<< type
|
||||||
|
<< "']\n"
|
||||||
"gridder.place_node(node, 1)\n"
|
"gridder.place_node(node, 1)\n"
|
||||||
"new_nodetree.links.new(node.outputs['Surface'], blend_node.inputs['Surface'])\n";
|
"new_nodetree.links.new(node.outputs['Surface'], blend_node.inputs['Surface'])\n";
|
||||||
_GenerateRootShader(out, 0, args...);
|
_GenerateRootShader(out, 0, args...);
|
||||||
|
@ -470,8 +458,7 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
/* Material Flags */
|
/* Material Flags */
|
||||||
out.format(fmt(
|
out.format(fmt("new_material.retro_depth_sort = {}\n"
|
||||||
"new_material.retro_depth_sort = {}\n"
|
|
||||||
"new_material.retro_alpha_test = {}\n"
|
"new_material.retro_alpha_test = {}\n"
|
||||||
"new_material.retro_samus_reflection = {}\n"
|
"new_material.retro_samus_reflection = {}\n"
|
||||||
"new_material.retro_depth_write = {}\n"
|
"new_material.retro_depth_write = {}\n"
|
||||||
|
@ -484,8 +471,8 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
||||||
material.flags.samusReflection() ? "True" : "False", material.flags.depthWrite() ? "True" : "False",
|
material.flags.samusReflection() ? "True" : "False", material.flags.depthWrite() ? "True" : "False",
|
||||||
material.flags.samusReflectionSurfaceEye() ? "True" : "False",
|
material.flags.samusReflectionSurfaceEye() ? "True" : "False",
|
||||||
material.flags.shadowOccluderMesh() ? "True" : "False",
|
material.flags.shadowOccluderMesh() ? "True" : "False",
|
||||||
material.flags.samusReflectionIndirectTexture() ? "True" : "False", material.flags.lightmap() ? "True" : "False",
|
material.flags.samusReflectionIndirectTexture() ? "True" : "False",
|
||||||
material.flags.shadowOccluderMesh() ? "0" : "1");
|
material.flags.lightmap() ? "True" : "False", material.flags.shadowOccluderMesh() ? "0" : "1");
|
||||||
|
|
||||||
/* Texture Indices */
|
/* Texture Indices */
|
||||||
out << "tex_maps = []\n";
|
out << "tex_maps = []\n";
|
||||||
|
@ -538,130 +525,329 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
||||||
uint32_t hash = _HashTextureConfig(material);
|
uint32_t hash = _HashTextureConfig(material);
|
||||||
switch (hash) {
|
switch (hash) {
|
||||||
case 0x0473AE40: /* RetroShader: Lightmap, Diffuse, Emissive, Alpha=1.0 */
|
case 0x0473AE40: /* RetroShader: Lightmap, Diffuse, Emissive, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex);
|
||||||
|
break;
|
||||||
case 0x072D2CB3: /* RetroShader: Diffuse, Emissive, Reflection, Alpha=1.0 */
|
case 0x072D2CB3: /* RetroShader: Diffuse, Emissive, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, WhiteColorLink("Specular"), "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, WhiteColorLink("Specular"),
|
||||||
|
"Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0x0879D346: /* RetroShader: KColorDiffuse, Alpha=Texture */
|
case 0x0879D346: /* RetroShader: KColorDiffuse, Alpha=Texture */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Alpha"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Alpha"_tex);
|
||||||
|
break;
|
||||||
case 0x0DA256BB: /* Lightmap, Diffuse, Specular, Reflection, Alpha=KAlpha */
|
case 0x0DA256BB: /* Lightmap, Diffuse, Specular, Reflection, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex,
|
||||||
|
"Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x11C41DA4: /* RetroDynamicCharacterShader: Diffuse, DynamicMaskTex, Specular, Reflection, Alpha=1.0 */
|
case 0x11C41DA4: /* RetroDynamicCharacterShader: Diffuse, DynamicMaskTex, Specular, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroDynamicCharacterShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroDynamicCharacterShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex,
|
||||||
|
"Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0x1218F83E: /* RetroShader: ObjLightmap, Diffuse, ExtendedSpecular, Reflection, Alpha=DiffuseAlpha */
|
case 0x1218F83E: /* RetroShader: ObjLightmap, Diffuse, ExtendedSpecular, Reflection, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, ExtendedSpecularLink(), "Reflection"_tex, TexLink("Alpha", 1, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, ExtendedSpecularLink(), "Reflection"_tex,
|
||||||
|
TexLink("Alpha", 1, true));
|
||||||
|
break;
|
||||||
case 0x129B8578: /* RetroShader: KColorDiffuse, Emissive, Alpha=KAlpha */
|
case 0x129B8578: /* RetroShader: KColorDiffuse, Emissive, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Emissive"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Emissive"_tex, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x15A3E6E5: /* RetroShader: Diffuse, Alpha=KAlpha */
|
case 0x15A3E6E5: /* RetroShader: Diffuse, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x1BEB3E15: /* RetroShader: Diffuse, Alpha=DiffuseAlpha */
|
case 0x1BEB3E15: /* RetroShader: Diffuse, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, TexLink("Alpha", 0, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, TexLink("Alpha", 0, true));
|
||||||
|
break;
|
||||||
case 0x2261E0EB: /* RetroShader: Diffuse, Emissive, Specular, Reflection, Alpha=1.0 */
|
case 0x2261E0EB: /* RetroShader: Diffuse, Emissive, Specular, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0x239C7724: /* RetroDynamicShader: Diffuse*Dynamic, Emissive*Dynamic, Alpha=1.0 */
|
case 0x239C7724: /* RetroDynamicShader: Diffuse*Dynamic, Emissive*Dynamic, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroDynamicShader", "Diffuse"_tex, "Emissive"_tex); break;
|
_GenerateRootShader(out, "RetroDynamicShader", "Diffuse"_tex, "Emissive"_tex);
|
||||||
|
break;
|
||||||
case 0x240C4C84: /* RetroShader: Lightmap, KColorDiffuse, Specular, Reflection, Alpha=KAlpha */
|
case 0x240C4C84: /* RetroShader: Lightmap, KColorDiffuse, Specular, Reflection, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Specular"_tex, "Reflection"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Specular"_tex, "Reflection"_tex,
|
||||||
|
"Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x2523A379: /* RetroDynamicShader: Emissive*Dynamic, Specular, Reflection, Alpha=1.0 */
|
case 0x2523A379: /* RetroDynamicShader: Emissive*Dynamic, Specular, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroDynamicShader", "Emissive"_tex, "Specular"_tex, "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroDynamicShader", "Emissive"_tex, "Specular"_tex, "Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0x25E85017: /* RetroShader: Lightmap, KColorDiffuse, Alpha=KAlpha */
|
case 0x25E85017: /* RetroShader: Lightmap, KColorDiffuse, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x27FD5C6C: /* RetroShader: ObjLightmap, Diffuse, Specular, Reflection, Alpha=DiffuseAlpha */
|
case 0x27FD5C6C: /* RetroShader: ObjLightmap, Diffuse, Specular, Reflection, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, TexLink("Alpha", 1, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex,
|
||||||
|
TexLink("Alpha", 1, true));
|
||||||
|
break;
|
||||||
case 0x2AD9F535: /* RetroShader: Emissive, Reflection, Alpha=1.0 */
|
case 0x2AD9F535: /* RetroShader: Emissive, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Emissive"_tex, WhiteColorLink("Specular"), "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Emissive"_tex, WhiteColorLink("Specular"), "Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0x2C9F5104: /* RetroShader: Diffuse, Specular, Reflection, Alpha=KAlpha */
|
case 0x2C9F5104: /* RetroShader: Diffuse, Specular, Reflection, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x2D059429: /* RetroShader: Diffuse, Emissive, ExtendedSpecular, Reflection, Alpha=1.0 */
|
case 0x2D059429: /* RetroShader: Diffuse, Emissive, ExtendedSpecular, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, ExtendedSpecularLink(), "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, ExtendedSpecularLink(), "Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0x30AC64BB: /* RetroShader: Diffuse, Specular, Reflection, Alpha=KAlpha, IndirectTex */
|
case 0x30AC64BB: /* RetroShader: Diffuse, Specular, Reflection, Alpha=KAlpha, IndirectTex */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "IndirectTex"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "IndirectTex"_tex,
|
||||||
case 0x39BC4809: /* RetroDynamicShader: ObjLightmap*Dynamic, Diffuse*Dynamic, Emissive*Dynamic, Specular, Reflection, Alpha=1.0 */
|
"Alpha"_kcola);
|
||||||
_GenerateRootShader(out, "RetroDynamicShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex); break;
|
break;
|
||||||
|
case 0x39BC4809: /* RetroDynamicShader: ObjLightmap*Dynamic, Diffuse*Dynamic, Emissive*Dynamic, Specular, Reflection,
|
||||||
|
Alpha=1.0 */
|
||||||
|
_GenerateRootShader(out, "RetroDynamicShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, "Specular"_tex,
|
||||||
|
"Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0x3BF97299: /* RetroShader: Lightmap, Diffuse, Specular, Reflection, Alpha=KAlpha, IndirectTex */
|
case 0x3BF97299: /* RetroShader: Lightmap, Diffuse, Specular, Reflection, Alpha=KAlpha, IndirectTex */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "IndirectTex"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex,
|
||||||
|
"IndirectTex"_tex, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x47ECF3ED: /* RetroShader: Diffuse, Specular, Reflection, Emissive, Alpha=1.0 */
|
case 0x47ECF3ED: /* RetroShader: Diffuse, Specular, Reflection, Emissive, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "Emissive"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "Emissive"_tex);
|
||||||
|
break;
|
||||||
case 0x4BBDFFA6: /* RetroShader: Diffuse, Emissive, Alpha=1.0 */
|
case 0x4BBDFFA6: /* RetroShader: Diffuse, Emissive, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex);
|
||||||
|
break;
|
||||||
case 0x4D4127A3: /* RetroShader: Lightmap, Diffuse, Specular, Reflection, Alpha=DiffuseAlpha */
|
case 0x4D4127A3: /* RetroShader: Lightmap, Diffuse, Specular, Reflection, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, TexLink("Alpha", 1, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex,
|
||||||
|
TexLink("Alpha", 1, true));
|
||||||
|
break;
|
||||||
case 0x54A92F25: /* RetroShader: ObjLightmap, KColorDiffuse, Alpha=KAlpha */
|
case 0x54A92F25: /* RetroShader: ObjLightmap, KColorDiffuse, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
|
case 0x07AA75D7:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0x72BEDDAC:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||||
|
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_TEXC -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||||
|
A:CC_ZERO B:CC_C2 C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: true
|
||||||
|
*/
|
||||||
|
case 0x03FEE002:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0xF4DA0A86:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_KONST D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0xF345C16E:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0x8C562AB1:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0xE92F1340:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_TEXA C:CA_APREV D:CA_ZERO -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0xCE06F3F2:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_TEXA C:CA_APREV D:CA_ZERO -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0xC0E3FF1F:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_KONST D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_TEXC -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||||
|
A:CC_ZERO B:CC_C2 C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0xFC2761B8:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_RASC -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||||
|
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_TEXA C:CA_APREV D:CA_ZERO -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: true
|
||||||
|
*/
|
||||||
|
case 0xE64D1085:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_RASC -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||||
|
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: true
|
||||||
|
*/
|
||||||
|
case 0xB26E9E2E:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_TEXC -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_C2 -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0x4184FBCA:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_RASC -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||||
|
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: true
|
||||||
|
*/
|
||||||
|
case 0x81106196:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0x15A00948:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_TEXC -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||||
|
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_C2 -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||||
|
A:CC_ZERO B:CC_C2 C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: false
|
||||||
|
*/
|
||||||
|
case 0xFFF3CEBB:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_RASC -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||||
|
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_TEXA C:CA_APREV D:CA_ZERO -> TEVPREV
|
||||||
|
HasIndirect: false HasLightmap: true
|
||||||
|
*/
|
||||||
|
case 0x58BAA415:
|
||||||
|
/* TODO: Properly implement TEV configuration:
|
||||||
|
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_RASC -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||||
|
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||||
|
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_TEXC -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||||
|
HasIndirect: false HasLightmap: true
|
||||||
|
*/
|
||||||
case 0x54C6204C:
|
case 0x54C6204C:
|
||||||
_GenerateRootShader(out, "RetroShader"); break;
|
_GenerateRootShader(out, "RetroShader");
|
||||||
|
break;
|
||||||
case 0x5A62D5F0: /* RetroShader: Lightmap, Diffuse, UnusedExtendedSpecular?, Alpha=DiffuseAlpha */
|
case 0x5A62D5F0: /* RetroShader: Lightmap, Diffuse, UnusedExtendedSpecular?, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true));
|
||||||
|
break;
|
||||||
case 0x5CB59821: /* RetroShader: Diffuse, UnusedSpecular?, Alpha=KAlpha */
|
case 0x5CB59821: /* RetroShader: Diffuse, UnusedSpecular?, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x5D0F0069: /* RetroShader: Diffuse, Emissive, Alpha=DiffuseAlpha */
|
case 0x5D0F0069: /* RetroShader: Diffuse, Emissive, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, TexLink("Alpha", 0, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, TexLink("Alpha", 0, true));
|
||||||
|
break;
|
||||||
case 0x5D80E53C: /* RetroShader: Emissive, Specular, Reflection, Alpha=1.0 */
|
case 0x5D80E53C: /* RetroShader: Emissive, Specular, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Emissive"_tex, "Specular"_tex, "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Emissive"_tex, "Specular"_tex, "Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0x5F0AB0E9: /* RetroShader: Lightmap, Diffuse, UnusedSpecular?, Alpha=DiffuseAlpha */
|
case 0x5F0AB0E9: /* RetroShader: Lightmap, Diffuse, UnusedSpecular?, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true));
|
||||||
|
break;
|
||||||
case 0x5F189425: /* RetroShader: Lightmap, Diffuse, UnusedSpecular?, Alpha=KAlpha */
|
case 0x5F189425: /* RetroShader: Lightmap, Diffuse, UnusedSpecular?, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x6601D113: /* RetroShader: Emissive, Alpha=1.0 */
|
case 0x6601D113: /* RetroShader: Emissive, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Emissive"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Emissive"_tex);
|
||||||
|
break;
|
||||||
case 0x694287FA: /* RetroShader: Diffuse, Emissive, Reflection, Alpha=1.0 */
|
case 0x694287FA: /* RetroShader: Diffuse, Emissive, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, WhiteColorLink("Specular"), "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, WhiteColorLink("Specular"),
|
||||||
|
"Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0x6D98D689: /* RetroDynamicAlphaShader: Diffuse*Dynamic, Specular, Reflection, Alpha=KAlpha*Dynamic */
|
case 0x6D98D689: /* RetroDynamicAlphaShader: Diffuse*Dynamic, Specular, Reflection, Alpha=KAlpha*Dynamic */
|
||||||
_GenerateRootShader(out, "RetroDynamicAlphaShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroDynamicAlphaShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x7252CB90: /* RetroShader: Lightmap, Diffuse, Alpha=KAlpha */
|
case 0x7252CB90: /* RetroShader: Lightmap, Diffuse, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0x76BEA57E: /* RetroShader: Lightmap, Diffuse, Emissive, Specular, Reflection, Alpha=1.0, IndirectTex */
|
case 0x76BEA57E: /* RetroShader: Lightmap, Diffuse, Emissive, Specular, Reflection, Alpha=1.0, IndirectTex */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex, "IndirectTex"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, "Specular"_tex,
|
||||||
|
"Reflection"_tex, "IndirectTex"_tex);
|
||||||
|
break;
|
||||||
case 0x7D6A4487: /* RetroShader: Diffuse, Specular, Reflection, Alpha=DiffuseAlpha */
|
case 0x7D6A4487: /* RetroShader: Diffuse, Specular, Reflection, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, TexLink("Alpha", 0, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, TexLink("Alpha", 0, true));
|
||||||
|
break;
|
||||||
case 0x84319328: /* RetroShader: Reflection, UnusedSpecular?, Alpha=1.0 */
|
case 0x84319328: /* RetroShader: Reflection, UnusedSpecular?, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", WhiteColorLink("Specular"), "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroShader", WhiteColorLink("Specular"), "Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0x846215DA: /* RetroShader: Diffuse, Specular, Reflection, Alpha=DiffuseAlpha, IndirectTex */
|
case 0x846215DA: /* RetroShader: Diffuse, Specular, Reflection, Alpha=DiffuseAlpha, IndirectTex */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "IndirectTex"_tex, TexLink("Alpha", 0, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "IndirectTex"_tex,
|
||||||
|
TexLink("Alpha", 0, true));
|
||||||
|
break;
|
||||||
case 0x8E916C01: /* RetroShader: NULL, all inputs 0 */
|
case 0x8E916C01: /* RetroShader: NULL, all inputs 0 */
|
||||||
_GenerateRootShader(out, "RetroShader"); break;
|
_GenerateRootShader(out, "RetroShader");
|
||||||
|
break;
|
||||||
case 0x957709F8: /* RetroShader: Emissive, Alpha=1.0 */
|
case 0x957709F8: /* RetroShader: Emissive, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Emissive"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Emissive"_tex);
|
||||||
|
break;
|
||||||
case 0x96ABB2D3: /* RetroShader: Lightmap, Diffuse, Alpha=DiffuseAlpha */
|
case 0x96ABB2D3: /* RetroShader: Lightmap, Diffuse, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true));
|
||||||
|
break;
|
||||||
case 0x985A0B67: /* RetroShader: Diffuse, UnusedSpecular?, Alpha=DiffuseAlpha */
|
case 0x985A0B67: /* RetroShader: Diffuse, UnusedSpecular?, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, TexLink("Alpha", 0, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, TexLink("Alpha", 0, true));
|
||||||
|
break;
|
||||||
case 0x9B4453A2: /* RetroShader: Diffuse, Emissive, ExtendedSpecular, Reflection, Alpha=1.0 */
|
case 0x9B4453A2: /* RetroShader: Diffuse, Emissive, ExtendedSpecular, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, ExtendedSpecularLink(), "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, ExtendedSpecularLink(), "Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0xA187C630: /* RetroShader: Diffuse, Emissive, UnusedReflection?, Alpha=1.0 */
|
case 0xA187C630: /* RetroShader: Diffuse, Emissive, UnusedReflection?, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex);
|
||||||
|
break;
|
||||||
case 0xC138DCFA: /* RetroShader: Diffuse, Emissive, Alpha=1.0 */
|
case 0xC138DCFA: /* RetroShader: Diffuse, Emissive, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex);
|
||||||
|
break;
|
||||||
case 0xC3C8B1C8: /* RetroShader: KColorDiffuse, Alpha=KAlpha */
|
case 0xC3C8B1C8: /* RetroShader: KColorDiffuse, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0xC689C8C6: /* RetroShader: Diffuse, ExtendedSpecular, Reflection, Alpha=DiffuseAlpha */
|
case 0xC689C8C6: /* RetroShader: Diffuse, ExtendedSpecular, Reflection, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, ExtendedSpecularLink(), "Reflection"_tex, TexLink("Alpha", 0, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, ExtendedSpecularLink(), "Reflection"_tex,
|
||||||
|
TexLink("Alpha", 0, true));
|
||||||
|
break;
|
||||||
case 0xC6B18B28: /* RetroShader: Diffuse, Alpha=DiffuseAlpha */
|
case 0xC6B18B28: /* RetroShader: Diffuse, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, TexLink("Alpha", 0, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, TexLink("Alpha", 0, true));
|
||||||
|
break;
|
||||||
case 0xCD92D4C5: /* RetroShader: Diffuse, Reflection, Alpha=KAlpha */
|
case 0xCD92D4C5: /* RetroShader: Diffuse, Reflection, Alpha=KAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, WhiteColorLink("Specular"), "Reflection"_tex, "Alpha"_kcola); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, WhiteColorLink("Specular"), "Reflection"_tex, "Alpha"_kcola);
|
||||||
|
break;
|
||||||
case 0xD73E7728: /* RetroShader: ObjLightmap, Diffuse, Alpha=DiffuseAlpha */
|
case 0xD73E7728: /* RetroShader: ObjLightmap, Diffuse, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true));
|
||||||
|
break;
|
||||||
case 0xDB8F01AD: /* RetroDynamicShader: Diffuse*Dynamic, Emissive*Dynamic, UnusedSpecular?, Alpha=1.0 */
|
case 0xDB8F01AD: /* RetroDynamicShader: Diffuse*Dynamic, Emissive*Dynamic, UnusedSpecular?, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroDynamicShader", "Diffuse"_tex, "Emissive"_tex); break;
|
_GenerateRootShader(out, "RetroDynamicShader", "Diffuse"_tex, "Emissive"_tex);
|
||||||
|
break;
|
||||||
case 0xE6784B10: /* RetroShader: Lightmap, Diffuse, Specular, Reflection, Alpha=DiffuseAlpha, IndirectTex */
|
case 0xE6784B10: /* RetroShader: Lightmap, Diffuse, Specular, Reflection, Alpha=DiffuseAlpha, IndirectTex */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "IndirectTex"_tex, TexLink("Alpha", 1, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex,
|
||||||
|
"IndirectTex"_tex, TexLink("Alpha", 1, true));
|
||||||
|
break;
|
||||||
case 0xE68FF182: /* RetroShader: Diffuse, Emissive, Specular, Reflection, Alpha=1.0 */
|
case 0xE68FF182: /* RetroShader: Diffuse, Emissive, Specular, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0xEB4645CF: /* RetroDynamicAlphaShader: Diffuse*Dynamic, Alpha=DiffuseAlpha*Dynamic */
|
case 0xEB4645CF: /* RetroDynamicAlphaShader: Diffuse*Dynamic, Alpha=DiffuseAlpha*Dynamic */
|
||||||
_GenerateRootShader(out, "RetroDynamicAlphaShader", "Diffuse"_tex, TexLink("Alpha", 0, true)); break;
|
_GenerateRootShader(out, "RetroDynamicAlphaShader", "Diffuse"_tex, TexLink("Alpha", 0, true));
|
||||||
|
break;
|
||||||
case 0xECEF8D1F: /* RetroDynamicShader: Diffuse*Dynamic, Emissive*Dynamic, Specular, Reflection, Alpha=1.0 */
|
case 0xECEF8D1F: /* RetroDynamicShader: Diffuse*Dynamic, Emissive*Dynamic, Specular, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroDynamicShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroDynamicShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0xF1C26570: /* RetroShader: Lightmap, Diffuse, Specular, ExtendedSpecular, Reflection, Alpha=DiffuseAlpha */
|
case 0xF1C26570: /* RetroShader: Lightmap, Diffuse, Specular, ExtendedSpecular, Reflection, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "ExtendedSpecular"_tex, "Reflection"_tex, TexLink("Alpha", 1, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "ExtendedSpecular"_tex,
|
||||||
|
"Reflection"_tex, TexLink("Alpha", 1, true));
|
||||||
|
break;
|
||||||
case 0xF559DB08: /* RetroShader: Lightmap, Diffuse, Emissive, Specular, Reflection, Alpha=1.0 */
|
case 0xF559DB08: /* RetroShader: Lightmap, Diffuse, Emissive, Specular, Reflection, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, "Specular"_tex,
|
||||||
|
"Reflection"_tex);
|
||||||
|
break;
|
||||||
case 0xF9324367: /* RetroShader: Lightmap, Diffuse, Emissive, Alpha=1.0 */
|
case 0xF9324367: /* RetroShader: Lightmap, Diffuse, Emissive, Alpha=1.0 */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex);
|
||||||
|
break;
|
||||||
case 0xFD95D7FD: /* RetroShader: ObjLightmap, Diffuse, Alpha=DiffuseAlpha */
|
case 0xFD95D7FD: /* RetroShader: ObjLightmap, Diffuse, Alpha=DiffuseAlpha */
|
||||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true)); break;
|
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
_DescribeTEV(material);
|
_DescribeTEV(material);
|
||||||
Log.report(logvisor::Fatal, fmt("Unable to resolve shader hash {:08X}\n"), hash); break;
|
Log.report(logvisor::Fatal, fmt("Unable to resolve shader hash {:08X}\n"), hash);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Has Lightmap? */
|
/* Has Lightmap? */
|
||||||
|
@ -682,8 +868,7 @@ void MaterialSet::ConstructMaterial(Stream& out, const MaterialSet::Material& ma
|
||||||
_ConstructMaterial(out, material, groupIdx, matIdx);
|
_ConstructMaterial(out, material, groupIdx, matIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialSet::Material::Material(const hecl::blender::Material& mat,
|
MaterialSet::Material::Material(const hecl::blender::Material& mat, std::vector<hecl::ProjectPath>& texPathsOut,
|
||||||
std::vector<hecl::ProjectPath>& texPathsOut,
|
|
||||||
int colorCount, bool lightmapUVs, bool matrixSkinning) {
|
int colorCount, bool lightmapUVs, bool matrixSkinning) {
|
||||||
/* TODO: Rewrite for new shader rep */
|
/* TODO: Rewrite for new shader rep */
|
||||||
XXH32_state_t xxHash;
|
XXH32_state_t xxHash;
|
||||||
|
@ -1090,7 +1275,6 @@ void HMDLMaterialSet::Material::PASS::Enumerate(typename Op::StreamT& s) {
|
||||||
|
|
||||||
AT_SPECIALIZE_DNA(HMDLMaterialSet::Material::PASS)
|
AT_SPECIALIZE_DNA(HMDLMaterialSet::Material::PASS)
|
||||||
|
|
||||||
|
|
||||||
std::string_view HMDLMaterialSet::Material::PASS::DNAType() {
|
std::string_view HMDLMaterialSet::Material::PASS::DNAType() {
|
||||||
return "DataSpec::DNAMP1::HMDLMaterialSet::Material::PASS"sv;
|
return "DataSpec::DNAMP1::HMDLMaterialSet::Material::PASS"sv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,4 +79,121 @@ void CINF::sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID32& c
|
||||||
|
|
||||||
std::string CINF::GetCINFArmatureName(const UniqueID32& cinfId) { return fmt::format(fmt("CINF_{}"), cinfId); }
|
std::string CINF::GetCINFArmatureName(const UniqueID32& cinfId) { return fmt::format(fmt("CINF_{}"), cinfId); }
|
||||||
|
|
||||||
|
int CINF::RecursiveAddArmatureBone(const Armature& armature, const BlenderBone* bone, int parent, int& curId,
|
||||||
|
std::unordered_map<std::string, atInt32>& idMap,
|
||||||
|
std::map<std::string, int>& nameMap) {
|
||||||
|
int selId;
|
||||||
|
auto search = idMap.find(bone->name);
|
||||||
|
if (search == idMap.end()) {
|
||||||
|
selId = curId++;
|
||||||
|
idMap.emplace(std::make_pair(bone->name, selId));
|
||||||
|
} else
|
||||||
|
selId = search->second;
|
||||||
|
|
||||||
|
bones.emplace_back();
|
||||||
|
Bone& boneOut = bones.back();
|
||||||
|
nameMap[bone->name] = selId;
|
||||||
|
boneOut.id = selId;
|
||||||
|
boneOut.parentId = parent;
|
||||||
|
boneOut.origin = bone->origin;
|
||||||
|
boneOut.linkedCount = bone->children.size() + 1;
|
||||||
|
boneOut.linked.reserve(boneOut.linkedCount);
|
||||||
|
|
||||||
|
const BlenderBone* child;
|
||||||
|
boneOut.linked.push_back(parent);
|
||||||
|
for (size_t i = 0; (child = armature.getChild(bone, i)); ++i)
|
||||||
|
boneOut.linked.push_back(RecursiveAddArmatureBone(armature, child, boneOut.id, curId, idMap, nameMap));
|
||||||
|
|
||||||
|
return boneOut.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
CINF::CINF(const Armature& armature, std::unordered_map<std::string, atInt32>& idMap) {
|
||||||
|
idMap.reserve(armature.bones.size());
|
||||||
|
bones.reserve(armature.bones.size());
|
||||||
|
|
||||||
|
std::map<std::string, int> nameMap;
|
||||||
|
|
||||||
|
const BlenderBone* bone = armature.getRoot();
|
||||||
|
if (bone) {
|
||||||
|
if (bone->children.size()) {
|
||||||
|
int curId = 4;
|
||||||
|
const BlenderBone* child;
|
||||||
|
for (size_t i = 0; (child = armature.getChild(bone, i)); ++i)
|
||||||
|
RecursiveAddArmatureBone(armature, child, 3, curId, idMap, nameMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
bones.emplace_back();
|
||||||
|
Bone& boneOut = bones.back();
|
||||||
|
nameMap[bone->name] = 3;
|
||||||
|
boneOut.id = 3;
|
||||||
|
boneOut.parentId = 2;
|
||||||
|
boneOut.origin = bone->origin;
|
||||||
|
idMap.emplace(std::make_pair(bone->name, 3));
|
||||||
|
|
||||||
|
if (bone->children.size()) {
|
||||||
|
boneOut.linkedCount = 2;
|
||||||
|
boneOut.linked = {2, 4};
|
||||||
|
} else {
|
||||||
|
boneOut.linkedCount = 1;
|
||||||
|
boneOut.linked = {2};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boneCount = bones.size();
|
||||||
|
|
||||||
|
names.reserve(nameMap.size());
|
||||||
|
nameCount = nameMap.size();
|
||||||
|
for (const auto& name : nameMap) {
|
||||||
|
names.emplace_back();
|
||||||
|
Name& nameOut = names.back();
|
||||||
|
nameOut.name = name.first;
|
||||||
|
nameOut.boneId = name.second;
|
||||||
|
}
|
||||||
|
|
||||||
|
boneIdCount = boneCount;
|
||||||
|
boneIds.reserve(boneIdCount);
|
||||||
|
for (auto it = bones.crbegin(); it != bones.crend(); ++it)
|
||||||
|
boneIds.push_back(it->id);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CINF::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath,
|
||||||
|
PAKRouter<PAKBridge>& pakRouter, const PAK::Entry& entry, bool force, hecl::blender::Token& btok,
|
||||||
|
std::function<void(const hecl::SystemChar*)> fileChanged) {
|
||||||
|
if (!force && outPath.isFile())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
auto& conn = btok.getBlenderConnection();
|
||||||
|
if (!conn.createBlend(outPath, hecl::blender::BlendType::Armature))
|
||||||
|
return false;
|
||||||
|
auto os = conn.beginPythonOut(true);
|
||||||
|
|
||||||
|
os.format(fmt("import bpy\n"
|
||||||
|
"from mathutils import Vector\n"
|
||||||
|
"bpy.context.scene.name = 'CINF_{}'\n"
|
||||||
|
"bpy.context.scene.hecl_arm_obj = bpy.context.scene.name\n"
|
||||||
|
"\n"
|
||||||
|
"# Clear Scene\n"
|
||||||
|
"if len(bpy.data.collections):\n"
|
||||||
|
" bpy.data.collections.remove(bpy.data.collections[0])\n"
|
||||||
|
"\n"), entry.id);
|
||||||
|
|
||||||
|
CINF cinf;
|
||||||
|
cinf.read(rs);
|
||||||
|
cinf.sendCINFToBlender(os, entry.id);
|
||||||
|
os.centerView();
|
||||||
|
os.close();
|
||||||
|
return conn.saveBlend();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CINF::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath,
|
||||||
|
const hecl::blender::Armature& armature) {
|
||||||
|
std::unordered_map<std::string, atInt32> boneIdMap;
|
||||||
|
CINF cinf(armature, boneIdMap);
|
||||||
|
|
||||||
|
/* Write out CINF resource */
|
||||||
|
athena::io::TransactionalFileWriter w(outPath.getAbsolutePath());
|
||||||
|
cinf.write(w);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace DataSpec::DNAMP2
|
} // namespace DataSpec::DNAMP2
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "DataSpec/DNACommon/DNACommon.hpp"
|
#include "DataSpec/DNACommon/DNACommon.hpp"
|
||||||
#include "DataSpec/DNACommon/RigInverter.hpp"
|
#include "DataSpec/DNACommon/RigInverter.hpp"
|
||||||
|
#include "DNAMP2.hpp"
|
||||||
|
|
||||||
namespace DataSpec::DNAMP2 {
|
namespace DataSpec::DNAMP2 {
|
||||||
|
|
||||||
|
@ -37,6 +38,22 @@ struct CINF : BigDNA {
|
||||||
void sendVertexGroupsToBlender(hecl::blender::PyOutStream& os) const;
|
void sendVertexGroupsToBlender(hecl::blender::PyOutStream& os) const;
|
||||||
void sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID32& cinfId) const;
|
void sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID32& cinfId) const;
|
||||||
static std::string GetCINFArmatureName(const UniqueID32& cinfId);
|
static std::string GetCINFArmatureName(const UniqueID32& cinfId);
|
||||||
|
|
||||||
|
CINF() = default;
|
||||||
|
using Armature = hecl::blender::Armature;
|
||||||
|
using BlenderBone = hecl::blender::Bone;
|
||||||
|
|
||||||
|
int RecursiveAddArmatureBone(const Armature& armature, const BlenderBone* bone, int parent, int& curId,
|
||||||
|
std::unordered_map<std::string, atInt32>& idMap, std::map<std::string, int>& nameMap);
|
||||||
|
|
||||||
|
CINF(const Armature& armature, std::unordered_map<std::string, atInt32>& idMap);
|
||||||
|
|
||||||
|
static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath,
|
||||||
|
PAKRouter<PAKBridge>& pakRouter, const PAK::Entry& entry, bool force, hecl::blender::Token& btok,
|
||||||
|
std::function<void(const hecl::SystemChar*)> fileChanged);
|
||||||
|
|
||||||
|
static bool Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath,
|
||||||
|
const hecl::blender::Armature& armature);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace DataSpec::DNAMP2
|
} // namespace DataSpec::DNAMP2
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "MLVL.hpp"
|
#include "MLVL.hpp"
|
||||||
#include "CMDL.hpp"
|
#include "CMDL.hpp"
|
||||||
#include "ANCS.hpp"
|
#include "ANCS.hpp"
|
||||||
|
#include "CINF.hpp"
|
||||||
#include "MREA.hpp"
|
#include "MREA.hpp"
|
||||||
#include "MAPA.hpp"
|
#include "MAPA.hpp"
|
||||||
#include "MAPU.hpp"
|
#include "MAPU.hpp"
|
||||||
|
@ -234,6 +235,8 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const nod::Node& pakNode, con
|
||||||
return {SAVWCommon::ExtractSAVW<SAVW>, {_SYS_STR(".yaml")}};
|
return {SAVWCommon::ExtractSAVW<SAVW>, {_SYS_STR(".yaml")}};
|
||||||
case SBIG('CMDL'):
|
case SBIG('CMDL'):
|
||||||
return {CMDL::Extract, {_SYS_STR(".blend")}, 1};
|
return {CMDL::Extract, {_SYS_STR(".blend")}, 1};
|
||||||
|
case SBIG('CINF'):
|
||||||
|
return {CINF::Extract, {_SYS_STR(".blend")}, 1};
|
||||||
case SBIG('ANCS'):
|
case SBIG('ANCS'):
|
||||||
return {ANCS::Extract, {_SYS_STR(".yaml"), _SYS_STR(".blend")}, 2};
|
return {ANCS::Extract, {_SYS_STR(".yaml"), _SYS_STR(".blend")}, 2};
|
||||||
case SBIG('MLVL'):
|
case SBIG('MLVL'):
|
||||||
|
|
|
@ -26,12 +26,15 @@ void DeafBabe::BlenderInit(hecl::blender::PyOutStream& os) {
|
||||||
" 'Rubber':(0.09, 0.02, 0.01)}\n"
|
" 'Rubber':(0.09, 0.02, 0.01)}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"# Diffuse Color Maker\n"
|
"# Diffuse Color Maker\n"
|
||||||
|
"from mathutils import Color\n"
|
||||||
"def make_color(index, mat_type, name):\n"
|
"def make_color(index, mat_type, name):\n"
|
||||||
" new_mat = bpy.data.materials.new(name)\n"
|
" new_mat = bpy.data.materials.new(name)\n"
|
||||||
" if mat_type in TYPE_COLORS:\n"
|
" if mat_type in TYPE_COLORS:\n"
|
||||||
" new_mat.diffuse_color = TYPE_COLORS[mat_type]\n"
|
" new_mat.diffuse_color = TYPE_COLORS[mat_type] + (1.0,)\n"
|
||||||
" else:\n"
|
" else:\n"
|
||||||
" new_mat.diffuse_color.hsv = ((index / 6.0) % 1.0, 1.0-((index // 6) / 6.0), 1)\n"
|
" col = Color()\n"
|
||||||
|
" col.hsv = ((index / 6.0) % 1.0, 1.0-((index // 6) / 6.0), 1)\n"
|
||||||
|
" new_mat.diffuse_color = tuple(col) + (1.0,)\n"
|
||||||
" return new_mat\n"
|
" return new_mat\n"
|
||||||
"\n"
|
"\n"
|
||||||
"bpy.types.Material.retro_unknown = bpy.props.BoolProperty(description='Retro: Unknown (U)')\n"
|
"bpy.types.Material.retro_unknown = bpy.props.BoolProperty(description='Retro: Unknown (U)')\n"
|
||||||
|
|
Loading…
Reference in New Issue