// Copyright (c) Wojciech Figat. All rights reserved.
#pragma once
#include "Engine/Scripting/ScriptingType.h"
#include "PostProcessSettings.h"
#include "Enums.h"
///
/// Graphics device manager that creates, manages and releases graphics device and related objects.
///
API_CLASS(Static, Attributes="DebugCommand") class FLAXENGINE_API Graphics
{
DECLARE_SCRIPTING_TYPE_NO_SPAWN(Graphics);
public:
///
/// Enables rendering synchronization with the refresh rate of the display device to avoid "tearing" artifacts.
///
API_FIELD() static bool UseVSync;
///
/// Anti Aliasing quality setting.
///
API_FIELD() static Quality AAQuality;
///
/// Screen Space Reflections quality setting.
///
API_FIELD() static Quality SSRQuality;
///
/// Screen Space Ambient Occlusion quality setting.
///
API_FIELD() static Quality SSAOQuality;
///
/// Volumetric Fog quality setting.
///
API_FIELD() static Quality VolumetricFogQuality;
///
/// The shadows quality.
///
API_FIELD() static Quality ShadowsQuality;
///
/// The shadow maps quality (textures resolution).
///
API_FIELD() static Quality ShadowMapsQuality;
///
/// The global scale for all shadow maps update rate. Can be used to slow down shadows rendering frequency on lower quality settings or low-end platforms. Default 1.
///
API_FIELD() static float ShadowUpdateRate;
///
/// Enables cascades splits blending for directional light shadows.
///
API_FIELD() static bool AllowCSMBlending;
///
/// The Global SDF quality. Controls the volume texture resolution and amount of cascades to use.
///
API_FIELD() static Quality GlobalSDFQuality;
///
/// The Global Illumination quality. Controls the quality of the GI effect.
///
API_FIELD() static Quality GIQuality;
///
/// Enables cascades splits blending for Global Illumination.
///
API_FIELD() static bool GICascadesBlending;
///
/// The default Post Process settings. Can be overriden by PostFxVolume on a level locally, per camera or for a whole map.
///
API_FIELD() static PostProcessSettings PostProcessSettings;
public:
///
/// Debug utility to toggle graphics workloads amortization over several frames by systems such as shadows mapping, global illumination or surface atlas. Can be used to test performance in the worst-case scenario (eg. camera-cut).
///
API_FIELD() static bool SpreadWorkload;
public:
// Post Processing effects rendering configuration.
API_CLASS(Static, Attributes = "DebugCommand") class FLAXENGINE_API PostProcessing
{
DECLARE_SCRIPTING_TYPE_MINIMAL(PostProcessing);
// Toggles between 2D and 3D LUT texture for Color Grading.
API_FIELD() static bool ColorGradingVolumeLUT;
};
public:
///
/// Disposes the device.
///
static void DisposeDevice();
};
// Skip disabling workload spreading in Release builds
#if BUILD_RELEASE
#define GPU_SPREAD_WORKLOAD true
#else
#define GPU_SPREAD_WORKLOAD Graphics::SpreadWorkload
#endif