MCPcopy Create free account
hub / github.com/DiligentGraphics/DiligentFX / UpdateUI

Method UpdateUI

PostProcess/DepthOfField/src/DepthOfField.cpp:331–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331bool DepthOfField::UpdateUI(HLSL::DepthOfFieldAttribs& Attribs, FEATURE_FLAGS& FeatureFlags)
332{
333 bool ActiveTemporalSmoothing = (FeatureFlags & FEATURE_FLAG_ENABLE_TEMPORAL_SMOOTHING) != 0;
334 bool ActiveKarisInverse = (FeatureFlags & FEATURE_FLAG_ENABLE_KARIS_INVERSE) != 0;
335
336 bool AttribsChanged = false;
337
338 if (ImGui::SliderFloat("CoC Limit factor", &Attribs.MaxCircleOfConfusion, 0.005f, 0.02f))
339 AttribsChanged = true;
340 ImGui::HelpMarker("The intensity of the depth of field effect.");
341
342 {
343 ImGui::ScopedDisabler Disabler{!ActiveTemporalSmoothing};
344 if (ImGui::SliderFloat("Temporal Stability Factor", &Attribs.TemporalStabilityFactor, 0.0f, 1.0f))
345 AttribsChanged = true;
346 ImGui::HelpMarker("This parameter is used to control the stability of the temporal accumulation of the CoC.");
347 }
348
349 if (ImGui::SliderInt("Bokeh Kernel Ring Count", &Attribs.BokehKernelRingCount, 2, 5))
350 AttribsChanged = true;
351 ImGui::HelpMarker("The number of rings in the Octaweb kernel.");
352
353 if (ImGui::SliderInt("Bokeh Kernel Ring Density", &Attribs.BokehKernelRingDensity, 2, 7))
354 AttribsChanged = true;
355 ImGui::HelpMarker("The number of samples within each ring of the Octaweb kernel.");
356
357 if (ImGui::Checkbox("Temporal Smoothing", &ActiveTemporalSmoothing))
358 AttribsChanged = true;
359 ImGui::HelpMarker("Enable temporal accumulation for CoC");
360
361 if (ImGui::Checkbox("Karis inverse", &ActiveKarisInverse))
362 AttribsChanged = true;
363 ImGui::HelpMarker("Increases the intensity of bokeh circles but may affect temporal stability.");
364
365 auto ResetStateFeatureMask = [](FEATURE_FLAGS& FeatureFlags, FEATURE_FLAGS Flag, bool State) {
366 if (State)
367 FeatureFlags |= Flag;
368 else
369 FeatureFlags &= ~Flag;
370 };
371
372 ResetStateFeatureMask(FeatureFlags, FEATURE_FLAG_ENABLE_TEMPORAL_SMOOTHING, ActiveTemporalSmoothing);
373 ResetStateFeatureMask(FeatureFlags, FEATURE_FLAG_ENABLE_KARIS_INVERSE, ActiveKarisInverse);
374 return AttribsChanged;
375}
376
377ITextureView* DepthOfField::GetDepthOfFieldTextureSRV() const
378{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected