lightmap updates: static lights, direct light contribution

This commit is contained in:
turanszkij
2018-12-21 15:27:49 +01:00
parent d6829a90f6
commit 9a81726f8d
21 changed files with 277 additions and 34 deletions
+14 -1
View File
@@ -13,7 +13,7 @@ LightWindow::LightWindow(wiGUI* gui) : GUI(gui)
float screenH = (float)wiRenderer::GetDevice()->GetScreenHeight();
lightWindow = new wiWindow(GUI, "Light Window");
lightWindow->SetSize(XMFLOAT2(650, 500));
lightWindow->SetSize(XMFLOAT2(650, 520));
//lightWindow->SetEnabled(false);
GUI->AddWidget(lightWindow);
@@ -158,6 +158,19 @@ LightWindow::LightWindow(wiGUI* gui) : GUI(gui)
haloCheckBox->SetTooltip("Visualize light source emission");
lightWindow->AddWidget(haloCheckBox);
staticCheckBox = new wiCheckBox("Static: ");
staticCheckBox->SetPos(XMFLOAT2(x, y += step));
staticCheckBox->OnClick([&](wiEventArgs args) {
LightComponent* light = wiRenderer::GetScene().lights.GetComponent(entity);
if (light != nullptr)
{
light->SetStatic(args.bValue);
}
});
staticCheckBox->SetEnabled(false);
staticCheckBox->SetTooltip("Static lights will only be used for baking into lightmaps.");
lightWindow->AddWidget(staticCheckBox);
addLightButton = new wiButton("Add Light");
addLightButton->SetPos(XMFLOAT2(x, y += step));
addLightButton->SetSize(XMFLOAT2(150, 30));