Envprobe MSAA (#466)

* envprobe MSAA support;
vulkan: transient attachment support;
dx12: renderpass resolve subresource improvement;

* envprobe window update

* envprobe gi boost fix

* probes will render fully diffuse scene, because inside probes there is no fallback reflection
This commit is contained in:
Turánszki János
2022-06-19 12:15:47 +02:00
committed by GitHub
parent af9187d846
commit d9174eb4bb
11 changed files with 185 additions and 54 deletions
+34 -5
View File
@@ -8,12 +8,21 @@ using namespace wi::scene;
void EnvProbeWindow::Create(EditorComponent* editor)
{
wi::gui::Window::Create("Environment Probe Window");
SetSize(XMFLOAT2(300, 200));
SetSize(XMFLOAT2(420, 220));
float x = 100, y = 0, step = 35;
float x = 5, y = 0, step = 35;
infoLabel.Create("");
infoLabel.SetText("Environment probes can be used to capture the scene from a specific location in a 360 degrees panorama. The probes will be used for reflections fallback, where a better reflection type is not available. The probes can affect the ambient colors slightly.\nTip: You can scale, rotate and move the probes to set up parallax correct rendering to affect a specific area only. The parallax correction will take effect inside the probe's bounds (indicated with a cyan colored box).");
infoLabel.SetSize(XMFLOAT2(400 - 10, 100));
infoLabel.SetPos(XMFLOAT2(x, y));
infoLabel.SetColor(wi::Color::Transparent());
AddWidget(&infoLabel);
y += infoLabel.GetScale().y + 5;
realTimeCheckBox.Create("RealTime: ");
realTimeCheckBox.SetPos(XMFLOAT2(x, y));
realTimeCheckBox.SetTooltip("Enable continuous rendering of the probe in every frame.");
realTimeCheckBox.SetPos(XMFLOAT2(x + 100, y));
realTimeCheckBox.SetEnabled(false);
realTimeCheckBox.OnClick([&](wi::gui::EventArgs args) {
EnvironmentProbeComponent* probe = wi::scene::GetScene().probes.GetComponent(entity);
@@ -25,7 +34,22 @@ void EnvProbeWindow::Create(EditorComponent* editor)
});
AddWidget(&realTimeCheckBox);
msaaCheckBox.Create("MSAA: ");
msaaCheckBox.SetTooltip("Enable Multi Sampling Anti Aliasing for the probe, this will improve its quality.");
msaaCheckBox.SetPos(XMFLOAT2(x + 200, y));
msaaCheckBox.SetEnabled(false);
msaaCheckBox.OnClick([&](wi::gui::EventArgs args) {
EnvironmentProbeComponent* probe = wi::scene::GetScene().probes.GetComponent(entity);
if (probe != nullptr)
{
probe->SetMSAA(args.bValue);
probe->SetDirty();
}
});
AddWidget(&msaaCheckBox);
generateButton.Create("Put");
generateButton.SetTooltip("Put down a new probe in front of the camera and capture the scene.");
generateButton.SetPos(XMFLOAT2(x, y += step));
generateButton.OnClick([=](wi::gui::EventArgs args) {
XMFLOAT3 pos;
@@ -48,7 +72,8 @@ void EnvProbeWindow::Create(EditorComponent* editor)
AddWidget(&generateButton);
refreshButton.Create("Refresh");
refreshButton.SetPos(XMFLOAT2(x, y += step));
refreshButton.SetTooltip("Re-renders the selected probe.");
refreshButton.SetPos(XMFLOAT2(x + 120, y));
refreshButton.SetEnabled(false);
refreshButton.OnClick([&](wi::gui::EventArgs args) {
EnvironmentProbeComponent* probe = wi::scene::GetScene().probes.GetComponent(entity);
@@ -60,7 +85,8 @@ void EnvProbeWindow::Create(EditorComponent* editor)
AddWidget(&refreshButton);
refreshAllButton.Create("Refresh All");
refreshAllButton.SetPos(XMFLOAT2(x, y += step));
refreshAllButton.SetTooltip("Re-renders all probes in the scene.");
refreshAllButton.SetPos(XMFLOAT2(x + 240, y));
refreshAllButton.SetEnabled(true);
refreshAllButton.OnClick([&](wi::gui::EventArgs args) {
Scene& scene = wi::scene::GetScene();
@@ -90,12 +116,15 @@ void EnvProbeWindow::SetEntity(Entity entity)
if (probe == nullptr)
{
realTimeCheckBox.SetEnabled(false);
msaaCheckBox.SetEnabled(false);
refreshButton.SetEnabled(false);
}
else
{
realTimeCheckBox.SetCheck(probe->IsRealTime());
realTimeCheckBox.SetEnabled(true);
msaaCheckBox.SetCheck(probe->IsMSAA());
msaaCheckBox.SetEnabled(true);
refreshButton.SetEnabled(true);
}
}