This commit is contained in:
GiJungSUk
2025-12-26 22:31:23 +09:00
parent 1f76888042
commit 3458b87e0e
145 changed files with 1114 additions and 186 deletions
@@ -365,6 +365,22 @@ HRESULT CEffectObject::Load(CEffect_Container::EFFECT_SAVE_INFO EffectSaveInfo,
}
}
if (m_EffectInfo.isNomalMap)
{
m_strNomalMapName = EffectSaveInfo.wstrNomalName;;
if (m_strDistortionName.length() > 0)
{
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), m_strNomalMapName,
reinterpret_cast<CComponent**>(&m_pNormal_TextureCom))))
{
return E_FAIL;
}
}
}
m_strModelName = EffectSaveInfo.wstrModelName;
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), m_strModelName,
@@ -627,6 +643,38 @@ HRESULT CEffectObject::Load(const _char* pFilePath, LEVEL eLevel)
}
}
if (m_EffectInfo.isNomalMap)
{
size_t iComponentLength = {};
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
CloseHandle(hFile);
return E_FAIL;
}
if (iComponentLength != 0)
{
_char szName[MAX_PATH] = {};
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
CloseHandle(hFile);
return E_FAIL;
}
m_strNomalMapName = CMyTools::ToWstring(szName);
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), m_strNomalMapName,
reinterpret_cast<CComponent**>(&m_pNormal_TextureCom))))
{
CloseHandle(hFile);
return E_FAIL;
}
}
}
size_t iComponentLength = {};
@@ -719,7 +767,7 @@ HRESULT CEffectObject::Bind_ShaderResources()
}
if (m_EffectInfo.isMotionBlur == true)
if (m_EffectInfo.isMotionBlur == true || m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::DEFAULT)
{
if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) {
@@ -1053,7 +1101,22 @@ HRESULT CEffectObject::Bind_ShaderResources()
}
}
if (m_pNormal_TextureCom != nullptr)
{
if (FAILED(m_pShaderCom->Bind_SRV("g_NormalTexture", m_pNormal_TextureCom->Get_SRV(0)))) {
return E_FAIL;
}
_float fUsingSurfaceParams = MRO_PARAMETER;
if (FAILED(m_pShaderCom->Bind_RawValue("g_fUsingSurfaceParams", &fUsingSurfaceParams, sizeof(_float))))
return E_FAIL;
if (FAILED(m_pShaderCom->Bind_SRV("g_SurfaceParamsTexture", m_pSurface_TextureCom->Get_SRV(0)))) {
return E_FAIL;
}
}
return S_OK;
@@ -1106,6 +1169,8 @@ void CEffectObject::Free()
SAFE_RELEASE(m_pDissolve_TextureCom);
SAFE_RELEASE(m_pEmissive_TextureCom);
SAFE_RELEASE(m_pDistortion_TextureCom);
SAFE_RELEASE(m_pNormal_TextureCom);
SAFE_RELEASE(m_pSurface_TextureCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pInstance_ModelCom);