Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit 9a8f00c

Browse files
committed
Support for more bump texture params.
1 parent 90e54b6 commit 9a8f00c

1 file changed

Lines changed: 25 additions & 11 deletions

File tree

Model Exporter/main.cxx

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "3rdParty/umHalf.h"
1010

1111
// Defines
12-
#define PROJECT_VERSION "v1.0.1"
12+
#define PROJECT_VERSION "v1.0.2"
1313
#define PROJECT_NAME "Model Exporter " PROJECT_VERSION
1414

1515
// SDK Stuff
@@ -503,17 +503,18 @@ int main(int p_Argc, char** p_Argv)
503503
m_MtlBase.m_Illum = 0;
504504
}
505505

506-
Illusion::MaterialParam_t* m_Diffuse = m_Material->GetParam(0xDCE06689); // texDiffuse
506+
static uint32_t m_DiffuseHashes[] =
507507
{
508+
0xDCE06689, // texDiffuse
509+
0x19410F73, // texDiffuse2
510+
0x5F95AF1, // texDiffuseWorld
511+
};
512+
for (uint32_t m_DiffuseNameUID : m_DiffuseHashes)
513+
{
514+
Illusion::MaterialParam_t* m_Diffuse = m_Material->GetParam(m_DiffuseNameUID);
508515
if (!m_Diffuse)
509-
m_Diffuse = m_Material->GetParam(0x19410F73); // texDiffuse2
516+
continue;
510517

511-
if (!m_Diffuse)
512-
m_Diffuse = m_Material->GetParam(0x5F95AF1); // texDiffuseWorld
513-
}
514-
515-
if (m_Diffuse)
516-
{
517518
UFG::ResourceData_t* m_DiffuseResource = m_PermFile.GetResourceData(m_Diffuse->m_NameUID);
518519
if (m_DiffuseResource)
519520
{
@@ -526,11 +527,22 @@ int main(int p_Argc, char** p_Argv)
526527
sprintf_s(m_Format, sizeof(m_Format), "../Textures/0x%X.png", m_Diffuse->m_NameUID);
527528
m_MtlBase.m_MapKd = m_Format;
528529
}
530+
531+
break;
529532
}
530533

531-
Illusion::MaterialParam_t* m_Normal = m_Material->GetParam(0xECADC789); // texNormal
532-
if (m_Normal)
534+
static uint32_t m_NormalHashes[] =
535+
{
536+
0xECADC789, // texNormal
537+
0xADBE1A5A, // texBump
538+
0xA348DC23, // texBump2
539+
};
540+
for (uint32_t m_NormalNameUID : m_NormalHashes)
533541
{
542+
Illusion::MaterialParam_t* m_Normal = m_Material->GetParam(m_NormalNameUID);
543+
if (!m_Normal)
544+
continue;
545+
534546
UFG::ResourceData_t* m_NormalResource = m_PermFile.GetResourceData(m_Normal->m_NameUID);
535547
if (m_NormalResource)
536548
{
@@ -540,6 +552,8 @@ int main(int p_Argc, char** p_Argv)
540552

541553
sprintf_s(m_Format, sizeof(m_Format), "../Textures/0x%X.png", m_Normal->m_NameUID);
542554
m_MtlBase.m_MapBump = m_Format;
555+
556+
break;
543557
}
544558

545559
Illusion::MaterialParam_t* m_Specular = m_Material->GetParam(0xCB460EC7); // texSpecular

0 commit comments

Comments
 (0)