SpiecsEngine
 
Loading...
Searching...
No Matches
ImguiPostProcessing.cpp
Go to the documentation of this file.
1/**
2* @file ImguiPostProcessing.cpp.
3* @brief The ImguiPostProcessing Class Implementation.
4* @author Spices.
5*/
6
7#include "Pchheader.h"
9#include "World/World/World.h"
10
11namespace Spices {
12
14 const std::string& panelName ,
15 FrameInfo& frameInfo
16 )
17 : ImguiSlate(panelName, frameInfo)
18 {
20 }
21
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 {
50 FrameInfo::Get().m_World->Mark(World::NeedUpdateTLAS | World::FrushStableFrame);
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();
63 FrameInfo::Get().m_World->Mark(World::NeedUpdateTLAS | World::FrushStableFrame);
64 }
65 ImGui::PopItemWidth();
66 }
67 });
68 return false;
69 });
70 });
71 }
72 }
73}
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
FrameInfo Class. This class defines the FrameInfo data.
Definition FrameInfo.h:32
static void DrawTreeTitle(const std::string &treeName, std::function< void()> optionFunc, std::function< void()> treeFunc)
Draw a stylized tree title bar.
The ImGuiH Class. This class defines helper function for slate render.
Definition ImguiHelper.h:61
virtual void OnRender() override
This interface is called On SlateRenderer Render.
ImguiPostProcessing(const std::string &panelName, FrameInfo &frameInfo)
Constructor Function.
The ImguiPostProcessing Class. This class defines how to render a PostProcessing options.
ImguiSlate(const std::string &panelName, FrameInfo &frameInfo)
Constructor Function. Init with Slate's name.
Definition ImguiUtils.h:35
This Class defines the basic behaves of specific slate. When we add an new Slate, we need inherit fro...
Definition ImguiUtils.h:27