Files
Hogwarts_Legacy/Jusin154_Team3D/Engine/Private/Shadow.cpp
T
2025-11-07 11:25:08 +09:00

36 lines
816 B
C++

#include "pch.h"
#include "Shadow.h"
#include "Shader.h"
CShadow::CShadow()
{
}
HRESULT CShadow::Ready_Shadow_Light(const SHADOW_LIGHT_DESC& Desc)
{
m_Desc = Desc;
XMStoreFloat4x4(&m_TransformationMatrices[ENUM_CLASS(D3DTS::VIEW)],
XMMatrixLookAtLH(XMLoadFloat4(&m_Desc.vEye), XMLoadFloat4(&m_Desc.vAt), XMVectorSet(0.f, 1.f, 0.f, 1.f)));
XMStoreFloat4x4(&m_TransformationMatrices[ENUM_CLASS(D3DTS::PROJ)],
XMMatrixOrthographicLH(m_Desc.fWidth, m_Desc.fHeight, m_Desc.fNear, m_Desc.fFar));
return S_OK;
}
HRESULT CShadow::Bind_Shadow_Resource(CShader* pShader, const _char* pConstantName, D3DTS eType) const
{
return pShader->Bind_Matrix(pConstantName, &m_TransformationMatrices[ENUM_CLASS(eType)]);
}
CShadow* CShadow::Create()
{
return new CShadow();
}
void CShadow::Free()
{
__super::Free();
}