minor update - light ui tweak

This commit is contained in:
2025-01-23 20:55:55 +01:00
parent c355509870
commit d8851cc679
12 changed files with 66 additions and 21 deletions

View File

@@ -75,13 +75,13 @@ void SunlightShaderClass::Shutdown()
}
bool SunlightShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
ID3D11ShaderResourceView* texture, XMFLOAT4 diffuseColor, XMFLOAT4 ambientColor, XMFLOAT3 sunDirection)
ID3D11ShaderResourceView* texture, XMFLOAT4 diffuseColor, XMFLOAT4 ambientColor, XMFLOAT3 sunDirection, float sunIntensity)
{
bool result;
// Set the shader parameters that it will use for rendering.
result = SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, diffuseColor, ambientColor, sunDirection);
result = SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, diffuseColor, ambientColor, sunDirection, sunIntensity);
if (!result)
{
Logger::Get().Log("Failed to set shader parameters", __FILE__, __LINE__, Logger::LogLevel::Error);
@@ -374,7 +374,7 @@ void SunlightShaderClass::OutputShaderErrorMessage(ID3D10Blob* errorMessage, HWN
}
bool SunlightShaderClass::SetShaderParameters(ID3D11DeviceContext* deviceContext, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, XMFLOAT4 ambientColor, XMFLOAT4 diffuseColor, XMFLOAT3 lightDirection)
bool SunlightShaderClass::SetShaderParameters(ID3D11DeviceContext* deviceContext, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, XMFLOAT4 ambientColor, XMFLOAT4 diffuseColor, XMFLOAT3 lightDirection, float sunIntensity)
{
HRESULT result;
D3D11_MAPPED_SUBRESOURCE mappedResource;
@@ -426,6 +426,7 @@ bool SunlightShaderClass::SetShaderParameters(ID3D11DeviceContext* deviceContext
dataPtr3->ambientColor = ambientColor;
dataPtr3->diffuseColor = diffuseColor;
dataPtr3->sunDirection = lightDirection;
dataPtr3->intensity = sunIntensity;
// Unlock the constant buffer.
deviceContext->Unmap(m_sunlightBuffer, 0);
@@ -442,9 +443,6 @@ bool SunlightShaderClass::SetShaderParameters(ID3D11DeviceContext* deviceContext
return true;
}
void SunlightShaderClass::RenderShader(ID3D11DeviceContext* deviceContext, int indexCount)
{
// Set the vertex input layout.