More improvements to SSAO

- we add an 'intensity' parameter that allows to control the strength
  of the AO effect. This is useful for aesthetic reasons.

- the default intensity is now 2x that of before this change, which
  makes the intensity parameter match AO papers this implementation
  is inspired of.

- bias is now z-dependent, which reduces some self shadowing wrt the
  depth.
This commit is contained in:
Pixelflinger
2019-11-15 00:29:18 -08:00
committed by Mathias Agopian
parent 5583dc26f9
commit 0da551c7fd
6 changed files with 27 additions and 8 deletions

View File

@@ -347,7 +347,8 @@ static void gui(filament::Engine* engine, filament::View*) {
DebugRegistry& debug = engine->getDebugRegistry();
ImGui::Checkbox("enabled###ssao", &params.ssao);
ImGui::SliderFloat("radius", &params.ssaoOptions.radius, 0.05f, 5.0f);
ImGui::SliderFloat("bias", &params.ssaoOptions.bias, 0.0f, 0.1f);
ImGui::SliderFloat("bias", &params.ssaoOptions.bias, 0.0f, 0.01f, "%.6f");
ImGui::SliderFloat("intensity", &params.ssaoOptions.intensity, 0.0f, 10.0f);
ImGui::SliderFloat("power", &params.ssaoOptions.power, 0.0f, 1.0f);
}
ImGui::Unindent();