minor update - préparation sunlight

This commit is contained in:
2025-01-22 19:56:28 +01:00
parent 261df5e257
commit d8552d3f91
14 changed files with 844 additions and 17 deletions

View File

@@ -134,6 +134,13 @@ bool ShaderManagerClass::Initialize(ID3D11Device* device, HWND hwnd)
return false;
}
m_SunlightShader = new SunlightShaderClass;
result = m_SunlightShader->Initialize(device, hwnd);
if (!result)
{
return false;
}
Logger::Get().Log("ShaderManagerClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
return true;
@@ -239,6 +246,13 @@ void ShaderManagerClass::Shutdown()
m_CelShadingShader = 0;
}
if (m_SunlightShader)
{
m_SunlightShader->Shutdown();
delete m_SunlightShader;
m_SunlightShader = 0;
}
Logger::Get().Log("ShaderManagerClass shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
}
@@ -419,4 +433,18 @@ bool ShaderManagerClass::RenderCelShadingShader(ID3D11DeviceContext* deviceConte
}
return true;
}
bool ShaderManagerClass::RenderSunlightShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
ID3D11ShaderResourceView* texture, XMFLOAT4 ambientColor, XMFLOAT4 diffuseColor, XMFLOAT4 sunColor)
{
bool result;
result = m_SunlightShader->Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, texture, ambientColor, diffuseColor, sunColor);
if (!result)
{
return false;
}
return true;
}