83 lines
2.3 KiB
C++
83 lines
2.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "SceneView.h"
|
|
#include "CoreMinimal.h"
|
|
#include "Engine/EngineTypes.h"
|
|
|
|
class FSceneViewFamily;
|
|
struct FGlobalShaderPermutationParameters;
|
|
enum EShaderPlatform : uint16;
|
|
class FRDGTexture;
|
|
using FRDGTextureRef = FRDGTexture*;
|
|
|
|
struct FScreenMessageWriter;
|
|
|
|
namespace ECastRayTracedShadow
|
|
{
|
|
enum Type : int;
|
|
};
|
|
|
|
namespace StochasticLighting
|
|
{
|
|
enum class EMaterialSource;
|
|
}
|
|
|
|
class FMegaLightsVolume
|
|
{
|
|
public:
|
|
FRDGTextureRef Texture = nullptr;
|
|
FRDGTextureRef TranslucencyAmbient[TVC_MAX] = {};
|
|
FRDGTextureRef TranslucencyDirectional[TVC_MAX] = {};
|
|
};
|
|
|
|
enum class EMegaLightsMode
|
|
{
|
|
Disabled,
|
|
EnabledRT,
|
|
EnabledVSM
|
|
};
|
|
|
|
// Public MegaLights interface
|
|
namespace MegaLights
|
|
{
|
|
bool IsEnabled(const FSceneViewFamily& ViewFamily);
|
|
|
|
bool IsUsingClosestHZB(const FSceneViewFamily& ViewFamily);
|
|
bool IsUsingGlobalSDF(const FSceneViewFamily& ViewFamily);
|
|
bool IsUsingLightFunctions(const FSceneViewFamily& ViewFamily);
|
|
bool IsUsingLightingChannels();
|
|
|
|
bool IsSoftwareRayTracingSupported(const FSceneViewFamily& ViewFamily);
|
|
bool IsHardwareRayTracingSupported(const FSceneViewFamily& ViewFamily);
|
|
|
|
EMegaLightsMode GetMegaLightsMode(const FSceneViewFamily& ViewFamily, uint8 LightType, bool bLightAllowsMegaLights, TEnumAsByte<EMegaLightsShadowMethod::Type> ShadowMethod);
|
|
bool UseHardwareRayTracing(const FSceneViewFamily& ViewFamily);
|
|
bool UseInlineHardwareRayTracing(const FSceneViewFamily& ViewFamily);
|
|
bool ShouldCompileShaders(EShaderPlatform ShaderPlatform);
|
|
bool ShouldCompileShadersForReferenceMode(EShaderPlatform ShaderPlatform);
|
|
|
|
bool UseFarField(const FSceneViewFamily& ViewFamily);
|
|
|
|
bool UseVolume();
|
|
|
|
bool UseTranslucencyVolume();
|
|
bool IsTranslucencyVolumeSpatialFilterEnabled();
|
|
bool IsTranslucencyVolumeTemporalFilterEnabled();
|
|
|
|
bool IsMarkingVSMPages();
|
|
|
|
uint32 GetSampleMargin();
|
|
|
|
bool HasWarning(const FSceneViewFamily& ViewFamily);
|
|
void WriteWarnings(const FSceneViewFamily& ViewFamily, FScreenMessageWriter& Writer);
|
|
|
|
BEGIN_SHADER_PARAMETER_STRUCT(FTileClassifyParameters, )
|
|
SHADER_PARAMETER(uint32, EnableTexturedRectLights)
|
|
END_SHADER_PARAMETER_STRUCT()
|
|
|
|
void SetupTileClassifyParameters(const FViewInfo& View, MegaLights::FTileClassifyParameters& OutParameters);
|
|
|
|
FIntPoint GetDownsampleFactorXY(StochasticLighting::EMaterialSource MaterialSource, EShaderPlatform ShaderPlatform);
|
|
}; |