SpiecsEngine
 
Loading...
Searching...
No Matches

◆ OnRender()

void Spices::ImguiPostProcessing::OnRender ( )
overridevirtual

This interface is called On SlateRenderer Render.

Implements Spices::ImguiSlate.

Definition at line 22 of file ImguiPostProcessing.cpp.

23 {
25
26 const float columeWidth = ImGuiH::GetLineItemSize().x * 10.0f;
27
28 {
29 SPICES_PROFILE_ZONEN("ImguiPostProcessing::Bloom");
30
31 const auto material = ResourcePool<Material>::Load<Material>("PostProcessRenderer.Bloom.Default");
32
33 ImGuiH::DrawMaterial("Bloom", columeWidth, material);
34 }
35
36 {
37 SPICES_PROFILE_ZONEN("ImguiPostProcessing::ToneMapping");
38
39 const auto material = ResourcePool<Material>::Load<Material>("PostProcessRenderer.ToneMapping.Default");
40
41 ImGuiH::DrawTreeTitle("ToneMapping", nullptr, [&]() {
42
43 material->GetConstantParams().for_each([&](const std::string& k, ConstantParams& v){
44 ImGuiH::DrawPropertyItem(k, columeWidth, nullptr, [&](){
45
46 if (k == "exposure")
47 {
48 if (ImGuiH::DrawMaterialConstParams<float>(material, ImGuiDataType_Float, 1, "%.3f", v))
49 {
51 }
52 }
53 if (k == "toneMapper")
54 {
55 int selected = std::any_cast<int>(v.value.paramValue);
56
57 static const char* toneMappers[] = { "AMD Tonemapper", "DX11DSK", "Reinhard", "Uncharted2Tonemap", "ACES", "No tonemapper" };
58 ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
59 if (ImGui::Combo("##", &selected, toneMappers, _countof(toneMappers)))
60 {
61 v.value.paramValue = selected;
62 material->UpdateMaterial();
64 }
65 ImGui::PopItemWidth();
66 }
67 });
68 return false;
69 });
70 });
71 }
72 }
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
static FrameInfo & Get()
Get FrameInfo.
Definition FrameInfo.cpp:14
std::shared_ptr< World > m_World
The shared pointer of specific world.
Definition FrameInfo.h:94
static ImVec2 GetLineItemSize()
Get Line Width's Square Size.
static void DrawMaterial(const std::string &name, float width, const std::shared_ptr< Material > &material)
Draw a Material.
static void DrawPropertyItem(const std::string &itemName, float columeWidth, std::function< void()> nameFunc, std::function< void()> valFunc)
Draw a single property.
static void DrawTreeTitle(const std::string &treeName, std::function< void()> optionFunc, std::function< void()> treeFunc)
Draw a stylized tree title bar.
@ FrushStableFrame
Definition World.h:48
@ NeedUpdateTLAS
Definition World.h:49

References Spices::ImGuiH::DrawTreeTitle().