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

@@ -438,8 +438,38 @@ bool imguiManager::ImGuiWidgetRenderer(ApplicationClass* app)
void imguiManager::WidgetLightWindow(ApplicationClass* app)
{
ImGui::Begin("Light", &showLightWindow);
// Sun light settings
LightClass* sunLight = app->GetSunLight();
// Direction input
XMFLOAT3 direction = sunLight->GetDirection();
float dir[3] = { direction.x, direction.y, direction.z };
if (ImGui::DragFloat3("Sun Direction", dir))
{
sunLight->SetDirection(dir[0], dir[1], dir[2]);
}
// Color input
XMFLOAT4 color = sunLight->GetDiffuseColor();
float col[3] = { color.x, color.y, color.z };
if (ImGui::ColorEdit3("Sun Color", col))
{
sunLight->SetDiffuseColor(col[0], col[1], col[2], 1.0f);
}
// Intensity input
float intensity = sunLight->GetIntensity();
if (ImGui::DragFloat("Sun Intensity", &intensity, 0.1f, 0.0f, 100.0f))
{
sunLight->SetIntensity(intensity);
}
ImGui::Separator();
int index = 0;
// Area light settings
for(auto& light : app->GetLights())
{
std::string headerName = "Light " + std::to_string(index);