Light Shader à corriger

This commit is contained in:
GolfOcean334
2024-04-10 12:57:31 +02:00
parent 05f12d15f9
commit d286e71ebe
4 changed files with 66 additions and 48 deletions

View File

@@ -9,6 +9,7 @@ ShaderManagerClass::ShaderManagerClass()
m_AlphaMapShader = 0;
m_SpecMapShader = 0;
m_TransparentShader = 0;
m_LightShader = 0;
}
@@ -89,6 +90,15 @@ bool ShaderManagerClass::Initialize(ID3D11Device* device, HWND hwnd)
return false;
}
// Create and initialize the light map shader object.
m_LightShader = new LightShaderClass;
result = m_LightShader->Initialize(device, hwnd);
if (!result)
{
return false;
}
return true;
}
@@ -150,6 +160,14 @@ void ShaderManagerClass::Shutdown()
m_TransparentShader = 0;
}
// Release the transparent shader object.
if (m_LightShader)
{
m_LightShader->Shutdown();
delete m_LightShader;
m_LightShader = 0;
}
return;
}
@@ -258,5 +276,20 @@ bool ShaderManagerClass::RenderTransparentShader(ID3D11DeviceContext* deviceCont
return false;
}
return true;
}
bool ShaderManagerClass::RenderlightShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
ID3D11ShaderResourceView* texture, XMFLOAT4 diffuseColor[], XMFLOAT4 lightPosition[])
{
bool result;
result = m_LightShader->Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, texture, diffuseColor, lightPosition);
if (!result)
{
return false;
}
return true;
}