31 ImGui::SameLine(ImGui::GetWindowContentRegionMax().x - 15);
32 ImGui::PushID(4321234 +
id++);
37 if (ImGui::SmallButton(
"T"))
41 if (ImGui::IsItemHovered())
60 _postFX(context.gfx().getRenderer().postFX())
69 const auto checkBox = [
this](
const FilterType filter,
const char* label =
"Enabled",
const bool overrideScene =
false) {
72 if (ImGui::Checkbox(label, &filterEnabled)) {
82 F32 edgeThreshold = batch.edgeDetectionThreshold();
83 ImGui::AlignTextToFramePadding();
84 ImGui::Text(
"Edge Threshold: "); ImGui::SameLine();
86 ImGui::PushItemWidth(170);
88 if (ImGui::SliderFloat(
"##hidelabel", &edgeThreshold, 0.01f, 1.0f)) {
89 batch.edgeDetectionThreshold(edgeThreshold);
92 ImGui::PopItemWidth();
94 if (ImGui::CollapsingHeader(
"Fog Settings")) {
95 bool sceneChanged =
false;
97 auto& activeSceneState = projectManager->activeProject()->getActiveScene()->state();
99 if (ImGui::Checkbox(
"Enabled", &fogEnabled)) {
105 F32 fogDensity = activeSceneState->renderState().fogDetails()._colourAndDensity.a;
106 if (ImGui::SliderFloat(
"Fog Density B", &fogDensity, 0.0001f, 0.25f,
"%.6f")) {
107 FogDetails details = activeSceneState->renderState().fogDetails();
109 activeSceneState->renderState().fogDetails(details);
114 F32 fogScatter = activeSceneState->renderState().fogDetails()._colourSunScatter.a;
115 if (ImGui::SliderFloat(
"Fog Density C", &fogScatter, 0.0001f, 0.25f,
"%.6f")) {
116 FogDetails details = activeSceneState->renderState().fogDetails();
118 activeSceneState->renderState().fogDetails(details);
123 FColour3 fogColour = activeSceneState->renderState().fogDetails()._colourAndDensity.rgb;
125 tempField.
_name =
"[Fog Colour]";
129 tempField.
_data = &fogColour;
131 tempField.
_range = { 0.0f, 1.0f };
132 tempField.
_dataSetter = [&](
const void* colour)
noexcept {
133 FogDetails details = activeSceneState->renderState().fogDetails();
135 activeSceneState->renderState().fogDetails(details);
147 if (ImGui::CollapsingHeader(
"SS Antialiasing")) {
150 I32 level =
to_I32(aaOp.postAAQualityLevel());
152 ImGui::PushItemWidth(175);
154 ImGui::AlignTextToFramePadding();
155 ImGui::Text(
"Quality level: "); ImGui::SameLine();
156 ImGui::PushID(
"quality_level_slider");
157 if (ImGui::SliderInt(
"##hidelabel", &level, 0, 5)) {
158 aaOp.postAAQualityLevel(
to_U8(level));
162 ImGui::PopItemWidth();
163 ImGui::AlignTextToFramePadding();
164 ImGui::Text(
"Method: "); ImGui::SameLine();
166 const bool a = ImGui::RadioButton(
"SMAA", &selection, 0); ImGui::SameLine();
167 const bool b = ImGui::RadioButton(
"FXAA", &selection, 1); ImGui::SameLine();
168 const bool c = ImGui::RadioButton(
"NONE", &selection, 2);
170 if (selection != 2) {
172 aaOp.useSMAA(selection == 0);
178 if (ImGui::CollapsingHeader(
"SS Ambient Occlusion")) {
189 if (ImGui::Checkbox(
"Generate Half Resolution", &halfRes)) {
192 if (ImGui::SliderFloat(
"Radius", &radius, 0.01f, 50.0f)) {
195 if (ImGui::SliderFloat(
"Power", &power, 1.0f, 10.0f)) {
198 if (ImGui::SliderFloat(
"Bias", &bias, 0.001f, 0.99f)) {
201 if (ImGui::SliderFloat(
"Max Range (%)", &range, 0.001f, 100.f)) {
204 if (ImGui::IsItemHovered()) {
205 ImGui::SetTooltip(
"100% - Far plane");
207 if (ImGui::SliderFloat(
"Fade Start (%)", &fade, 0.001f, 100.f)) {
210 if (ImGui::IsItemHovered()) {
211 ImGui::SetTooltip(
"Applies to the range [0 - Max Range], not to the far plane!");
214 if (ImGui::Checkbox(
"Blur results", &blur)) {
221 if (ImGui::SliderFloat(
"Blur threshold", &blurThreshold, 0.001f, 0.999f)) {
225 if (ImGui::SliderFloat(
"Blur sharpness", &blurSharpness, 0.001f, 128.0f)) {
229 if (ImGui::SliderInt(
"Blur kernel size", &kernelSize, 0, 16)) {
232 if (ImGui::IsItemHovered()) {
233 ImGui::SetTooltip(
"0 = no blur");
238 ImGui::Text(
"SSAO Sample Count: %d", ssaoOp.
sampleCount());
240 if (ImGui::CollapsingHeader(
"SS Reflections")) {
245 F32& jitterAmount = params.jitterAmount;
246 F32& stride = params.stride;
247 F32& zThickness = params.zThickness;
248 F32& strideZCutoff = params.strideZCutoff;
249 F32& screenEdgeFadeStart = params.screenEdgeFadeStart;
250 F32& eyeFadeStart = params.eyeFadeStart;
251 F32& eyeFadeEnd = params.eyeFadeEnd;
252 U16& maxSteps = params.maxSteps;
253 U8& binarySearchIterations = params.binarySearchIterations;
256 if (ImGui::SliderFloat(
"Max Distance", &maxDistance, 0.01f, 5000.0f)) {
259 if (ImGui::SliderFloat(
"Jitter Ammount", &jitterAmount, 0.01f, 10.0f)) {
262 if (ImGui::SliderFloat(
"Stride", &stride, 1.0f, maxSteps)) {
265 if (ImGui::SliderFloat(
"Z Thickness", &zThickness, 0.01f, 10.0f)) {
268 if (ImGui::SliderFloat(
"Strode Z Cutoff", &strideZCutoff, 0.01f, 1000.0f)) {
271 if (ImGui::SliderFloat(
"Screen Edge Fade Start", &screenEdgeFadeStart, 0.01f, 1.0f)) {
274 if (ImGui::SliderFloat(
"Eye fade start", &eyeFadeStart, 0.01f, 1.0f)) {
277 if (ImGui::SliderFloat(
"Eye fade end", &eyeFadeEnd, eyeFadeStart, 1.0f)) {
281 constexpr U16 stepsMin = 1u;
282 constexpr U16 stepsMax = 1 << 15;
284 if (ImGui::SliderScalar(
"Max Steps", ImGuiDataType_U16, &maxSteps, &stepsMin, &stepsMax)) {
287 constexpr U8 iterMin = 1u;
288 constexpr U8 iterMax = 1 << 7;
289 if (ImGui::SliderScalar(
"Binary Search Iterations", ImGuiDataType_U8, &binarySearchIterations, &iterMin, &iterMax)) {
299 if (ImGui::CollapsingHeader(
"Depth of Field")) {
306 if (ImGui::SliderFloat(
"Focal Length (mm)", &focalLength, 0.0f, 100.0f)) {
311 const char* crtStopName = params.fStop.c_str();
317 bool& autoFocus = params.autoFocus;
318 if (ImGui::Checkbox(
"Auto Focus", &autoFocus)) {
325 F32& focalDepth = params.focalDepth;
326 if (ImGui::SliderFloat(
"Focal Depth (m)", &focalDepth, 0.0f, 100.0f)) {
329 vec2<F32>& focalPosition = params.focalPoint;
330 if (ImGui::SliderFloat2(
"Focal Position", focalPosition.
_v, 0.0f, 1.0f)) {
333 if (ImGui::IsItemHovered()) {
334 ImGui::SetTooltip(
"Position of focused point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)");
340 bool& manualdof = params.manualdof;
341 if (ImGui::Checkbox(
"Manual dof calculation", &manualdof)) {
347 F32& ndofstart = params.ndofstart;
348 if (ImGui::SliderFloat(
"Near dof blur start", &ndofstart, 0.0f, 100.0f)) {
351 F32& ndofdist = params.ndofdist;
352 if (ImGui::SliderFloat(
"Near dof blur falloff distance", &ndofdist, 0.0f, 100.0f)) {
355 F32& fdofstart = params.fdofstart;
356 if (ImGui::SliderFloat(
"Far dof blur start", &fdofstart, 0.0f, 100.0f)) {
359 F32& fdofdist = params.fdofdist;
360 if (ImGui::SliderFloat(
"Far dof blur falloff distance", &fdofdist, 0.0f, 100.0f)) {
366 bool& vignetting = params.vignetting;
367 if (ImGui::Checkbox(
"Use optical lens vignetting", &vignetting)) {
373 F32& vignout = params.vignout;
374 if (ImGui::SliderFloat(
"Vignetting outer border", &vignout, 0.0f, 100.0f)) {
377 F32& vignin = params.vignin;
378 if (ImGui::SliderFloat(
"Vignetting inner border", &vignin, 0.0f, 100.0f)) {
385 bool& debugFocus = params.debugFocus;
386 if (ImGui::Checkbox(
"Show debug focus point and focal range", &debugFocus)) {
389 if (ImGui::IsItemHovered()) {
390 ImGui::SetTooltip(
"red = focal point, green = focal range");
401 if (ImGui::CollapsingHeader(
"Bloom")) {
406 if (ImGui::SliderFloat(
"Luminance Bias", &bias, 0.001f, 0.999f))
412 if (ImGui::CollapsingHeader(
"Motion Blur")) {
417 if (ImGui::SliderFloat(
"Veclocity Scale", &velocity, 0.01f, 3.0f)) {
421 U8 samples = blurOP.maxSamples();
constexpr U8 min = 1u, max = 16u;
422 if (ImGui::SliderScalar(
"Max Samples", ImGuiDataType_U8, &samples, &min, &max)) {
423 blurOP.maxSamples(samples);
427 if (ImGui::CollapsingHeader(
"Tone Mapping")) {
429 if (ImGui::Checkbox(
"Adaptive Exposure", &adaptiveExposure)) {
435 if (adaptiveExposure) {
436 if (ImGui::SliderFloat(
"Min Log Luminance", ¶ms.
_minLogLuminance, -16.0f, 0.0f)) {
439 if (ImGui::SliderFloat(
"Max Log Luminance", ¶ms.
_maxLogLuminance, 0.0f, 16.0f)) {
442 if (ImGui::SliderFloat(
"Tau", ¶ms.
_tau, 0.1f, 2.0f)) {
446 static I32 exposureRefreshFrameCount = 1;
447 static F32 exposure = 1.0f;
448 if (--exposureRefreshFrameCount == 0) {
450 exposureRefreshFrameCount = g_exposureRefreshFrameCount;
453 ImGui::Text(
"Current exposure value: %5.2f", exposure);
455 if (PreviewTextureButton(
id, batch.
luminanceTex(),
false))
476 if (ImGui::CollapsingHeader(
"Test Effects")) {
#define PROFILE_SCOPE_AUTO(CATEGORY)
F32 luminanceBias() const noexcept
void parametersChanged() noexcept
void parametersChanged() noexcept
PlatformContext & context() noexcept
PlatformContext & _context
Kernel & kernel() noexcept
Editor & editor() noexcept
Configuration & config() noexcept
void popFilter(const FilterType filter, const bool overrideScene=false)
bool getFilterState(const FilterType filter) const noexcept
PreRenderBatch & getFilterBatch() noexcept
void pushFilter(const FilterType filter, const bool overrideScene=false)
static const char * FilterName(FilterType filter) noexcept
Handle< Texture > _previewTexture
PostFXWindow(Editor &parent, PlatformContext &context, const Descriptor &descriptor)
void drawInternal() override
PreRenderOperator * getOperator(FilterType type) const
void toneMapParams(ToneMapParams params) noexcept
Handle< Texture > luminanceTex() const noexcept
void adaptiveExposureControl(bool state) noexcept
F32 adaptiveExposureValue() const noexcept
F32 bias() const noexcept
F32 blurSharpness() const noexcept
I32 blurKernelSize() const noexcept
bool blurResults() const noexcept
F32 blurThreshold() const noexcept
F32 fadeStart() const noexcept
U8 sampleCount() const noexcept
F32 radius() const noexcept
F32 power() const noexcept
F32 maxRange() const noexcept
bool genHalfRes() const noexcept
constexpr Optick::Category::Type GUI
const char * ToneMapFunctionsToString(ToneMapParams::MapFunctions stop) noexcept
FStops StringToFStops(const string &name)
const char * FStopsToString(const FStops stop) noexcept
Str StringFormat(const char *fmt, Args &&...args)
void PushNarrowLabelWidth()
void PopNarrowLabelWidth()
bool colourInput3(Editor &parent, EditorComponentField &field)
bool PreviewTextureButton(I32 &id, const Handle< Texture > tex, const bool readOnly)
constexpr I32 g_exposureRefreshFrameCount
Handle console commands that start with a forward slash.
void PushReadOnly(const bool fade)
constexpr U8 to_U8(const T value)
@ FILTER_SS_AMBIENT_OCCLUSION
constexpr I32 to_I32(const T value)
FORCE_INLINE T * Get(const Handle< T > handle)
constexpr auto to_base(const Type value) -> Type
struct Divide::Configuration::Rendering::PostFX::DOF dof
struct Divide::Configuration::Rendering::PostFX::MotionBlur motionBlur
struct Divide::Configuration::Rendering::PostFX::SSR ssr
struct Divide::Configuration::Rendering::PostFX postFX
struct Divide::Configuration::Rendering rendering
DELEGATE_STD< void, const void * > _dataSetter
vec2< F32 > _range
Used by slider_type as a min / max range or dropdown as selected_index / count.
PushConstantType _basicType
EditorComponentFieldType _type
vec4< F32 > _colourAndDensity
vec4< F32 > _colourSunScatter
F32 _manualExposureFactor