[add] subTroll
This commit is contained in:
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
|
After Width: | Height: | Size: 22 MiB |
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
|
After Width: | Height: | Size: 18 MiB |
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1638,20 +1638,8 @@ HRESULT CLoader::Loading_For_Bloom()
|
||||
#pragma region HAIR
|
||||
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair1/M_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_Hair1_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair2/M_Hair2.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_Hair2_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair3/M_Hair3.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_Hair3_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/FeMale/F_Hair1/F_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_F_Hair1_Model")
|
||||
MODEL::INDEPENDENT, "../Bin/Resources/Models/Monster/SubTroll/troll.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_SubTroll_Model")
|
||||
));
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -90,6 +90,51 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const aiMaterial* pAI
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CMaterial::Initialize(const _char* pModelFilePath, MODEL eType, const aiMaterial* pAIMaterial)
|
||||
{
|
||||
ID3D11ShaderResourceView* pSRV = { nullptr };
|
||||
|
||||
filesystem::path xmlFilePath = pModelFilePath;
|
||||
xmlFilePath.replace_extension(".xml");
|
||||
|
||||
tinyxml2::XMLDocument xmldoc;
|
||||
if ((tinyxml2::XML_SUCCESS != xmldoc.LoadFile(xmlFilePath.string().c_str()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
{
|
||||
tinyxml2::XMLNode* pNode = xmldoc.FirstChildElement("Material");
|
||||
if (pNode == nullptr){
|
||||
return E_FAIL;
|
||||
}
|
||||
tinyxml2::XMLElement* pRoot = pNode->FirstChildElement("Material");
|
||||
if (nullptr == pRoot) {
|
||||
return E_FAIL;
|
||||
}
|
||||
_int iIndex = 0;
|
||||
for (tinyxml2::XMLElement* pElement = pRoot->FirstChildElement("Container"); pElement; pElement = pElement->NextSiblingElement("Container"), ++iIndex)
|
||||
{
|
||||
const _char* pFileName = pElement->Attribute("Filename");
|
||||
const _char* pExtention = pElement->Attribute("Extension");
|
||||
|
||||
if (nullptr == pFileName || '\0' == pFileName[0]
|
||||
|| nullptr == pExtention || '\0' == pExtention[0]) {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
xmlFilePath.replace_filename(pFileName);
|
||||
xmlFilePath.replace_extension(pExtention);
|
||||
}
|
||||
pSRV = m_pGameInstance->Add_Resource(xmlFilePath.string().c_str());
|
||||
if (nullptr == pSRV) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_SRVs[iIndex].push_back(pSRV);
|
||||
m_SaveMaterial.Path[iIndex].push_back(xmlFilePath.string());
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CMaterial::Initialize(const _char* pMaterialFilePath, const _char* pTextureFilePath)
|
||||
{
|
||||
_char szTextureFilePath[MAX_PATH] = {};
|
||||
@@ -371,6 +416,19 @@ CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath, const aiMaterial* pAIMaterial)
|
||||
{
|
||||
CMaterial* pInstance = new CMaterial(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pModelFilePath, eType, pAIMaterial)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMaterial");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pMaterialFilePath, const _char* pTextureFilePath)
|
||||
{
|
||||
CMaterial* pInstance = new CMaterial(pDevice, pContext);
|
||||
@@ -417,8 +475,7 @@ HRESULT CMaterial::Bind_SRV(CShader* pShader)
|
||||
_float fUsingSurfaceParams = ((_float)iTextureType / (_float)AI_TEXTURE_TYPE_MAX);
|
||||
pConstantName = "g_SurfaceParamsTexture";
|
||||
pShader->Bind_RawValue("g_fUsingSurfaceParams", &fUsingSurfaceParams, sizeof(_float));
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
case aiTextureType_AMBIENT:
|
||||
break;
|
||||
case aiTextureType_EMISSIVE:
|
||||
@@ -449,8 +506,7 @@ HRESULT CMaterial::Bind_SRV(CShader* pShader)
|
||||
_float fUsingSurfaceParams = ((_float)iTextureType / (_float)AI_TEXTURE_TYPE_MAX);
|
||||
pConstantName = "g_SurfaceParamsTexture";
|
||||
pShader->Bind_RawValue("g_fUsingSurfaceParams", &fUsingSurfaceParams, sizeof(_float));
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
case aiTextureType_DIFFUSE_ROUGHNESS:
|
||||
break;
|
||||
case aiTextureType_AMBIENT_OCCLUSION:
|
||||
|
||||
@@ -733,6 +733,21 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CModel::Ready_Materials_Independent(MODEL eType, const aiScene* pAIScene, const _char* pModelFilePath)
|
||||
{
|
||||
m_iNumMaterials = pAIScene->mNumMaterials;
|
||||
m_Materials.reserve(m_iNumMaterials);
|
||||
for (size_t i = 0; i < m_iNumMaterials; ++i) {
|
||||
CMaterial* pMaterial = CMaterial::Create(m_pDevice, m_pContext, eType, pModelFilePath, pAIScene->mMaterials[i]);
|
||||
if (nullptr == pMaterial) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_Materials.push_back(pMaterial);
|
||||
}
|
||||
m_Materials.shrink_to_fit();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CModel::Ready_Animations(const aiScene* pAIScene)
|
||||
{
|
||||
m_iNumAnimations = pAIScene->mNumAnimations;
|
||||
@@ -1086,8 +1101,9 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma
|
||||
m_iRootBoneIndex = iRootBoneIndex;
|
||||
|
||||
m_pAIScene = m_Importer.ReadFile(pModelFilePath, iFlag);
|
||||
if (nullptr == m_pAIScene)
|
||||
if (nullptr == m_pAIScene){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
#pragma region Bone
|
||||
@@ -1107,8 +1123,11 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else if (MODEL::INDEPENDENT == eType) {
|
||||
if (FAILED(Ready_Materials_Independent(eType, m_pAIScene, pModelFilePath))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
} else {
|
||||
if (FAILED(Ready_Materials(m_pAIScene, pModelFilePath))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ enum class PXBODYSTATE {
|
||||
enum class MOUSEKEYSTATE { LBUTTON, RBUTTON, WBUTTON, XBUTTON };
|
||||
enum class MOUSEMOVESTATE { X, Y, W };
|
||||
enum class D3DTS { VIEW, PROJ, VIEW_INV, PROJ_INV, END };
|
||||
enum class MODEL { ANIM, NONANIM, ENVIROMENT };
|
||||
enum class MODEL { ANIM, NONANIM, INDEPENDENT, ENVIROMENT };
|
||||
|
||||
enum class NAVI_POINT { A, B, C, END };
|
||||
enum class NAVI_LINE { AB, BC, CA, END };
|
||||
|
||||
@@ -26,11 +26,13 @@ class ENGINE_DLL CMaterial final : public CBase
|
||||
SaveMaterial Get_SaveMaterial() { return m_SaveMaterial; }
|
||||
|
||||
static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, const aiMaterial* pAIMaterial);
|
||||
static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath, const aiMaterial* pAIMaterial);
|
||||
static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pMaterialFilePath, const _char* pTextureFilePath);
|
||||
private:
|
||||
SaveMaterial m_SaveMaterial;
|
||||
|
||||
HRESULT Initialize(const _char* pModelFilePath, const aiMaterial* pAIMaterial);
|
||||
HRESULT Initialize(const _char* pModelFilePath, MODEL eType, const aiMaterial* pAIMaterial);
|
||||
HRESULT Initialize(const _char* pMaterialFilePath, const _char* pTextureFilePath);
|
||||
HRESULT Read_MaterialFile(const _char* pMaterialFilePath, const _char* pTextureFolderPath);
|
||||
HRESULT Add_Texture(const _char* pTextureFolderPath, string& FileType);
|
||||
|
||||
@@ -93,6 +93,7 @@ class ENGINE_DLL CModel final : public CComponent
|
||||
HRESULT Save_PhysXTriMeshes(const _char* pModelFilePath);
|
||||
HRESULT Ready_Materials(const aiScene* pAIScene, const _char* pModelFilePath);
|
||||
HRESULT Ready_Materials_FromFile(const aiScene* pAIScene, const _char* pModelFilePath);
|
||||
HRESULT Ready_Materials_Independent(MODEL eType, const aiScene* pAIScene, const _char* pModelFilePath);
|
||||
HRESULT Ready_Animations(const aiScene* pAIScene);
|
||||
HRESULT Ready_Bones(const aiNode* pAINode, _int iParentIndex);
|
||||
// 바이너리
|
||||
|
||||
Reference in New Issue
Block a user