Shadows go brrr

This commit is contained in:
2025-01-16 14:03:28 +01:00
parent 8a3bf57d7e
commit 071caf51b6
22 changed files with 4140 additions and 3269 deletions

View File

@@ -17,6 +17,10 @@ ShadowMesh::ShadowMesh(ID3D11Device* devicePtr,
HRESULT result;
m_Material = material;
m_ColorEffectPtr->SetMaterial(material.get());
// Create input layout
D3D11_INPUT_ELEMENT_DESC vertexDesc[] = {
@@ -71,7 +75,6 @@ ShadowMesh::~ShadowMesh() {
void ShadowMesh::RenderShadow(ID3D11DeviceContext* deviceContextPtr, const Matrix& lightWorldViewProj) {
m_ShadowEffectPtr->SetLightWorldViewProjMatrix(lightWorldViewProj);
deviceContextPtr->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
deviceContextPtr->IASetInputLayout(m_InputLayoutPtr);
const UINT stride = sizeof(VertexIn);
@@ -90,7 +93,6 @@ void ShadowMesh::RenderShadow(ID3D11DeviceContext* deviceContextPtr, const Matri
void ShadowMesh::RenderFinal(ID3D11DeviceContext* deviceContextPtr, const Matrix& worldViewProj) {
m_ColorEffectPtr->SetWorldViewProjMatrix(worldViewProj);
deviceContextPtr->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
deviceContextPtr->IASetInputLayout(m_InputLayoutPtr);
const UINT stride = sizeof(VertexIn);
@@ -100,11 +102,11 @@ void ShadowMesh::RenderFinal(ID3D11DeviceContext* deviceContextPtr, const Matrix
D3DX11_TECHNIQUE_DESC techniqueDesc;
m_ColorEffectPtr->GetTechniquePtr()->GetDesc(&techniqueDesc);
for (UINT p = 0; p < techniqueDesc.Passes; ++p) {
m_ColorEffectPtr->GetTechniquePtr()->GetPassByIndex(p)->Apply(0, deviceContextPtr);
deviceContextPtr->DrawIndexed(m_IndicesCount, 0, 0);
}
}
void ShadowMesh::SetWorldMatrix(const Matrix& matrix) {