Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/RectLightTextureManager.h
Charles deRousiers 48b3286bc0 Add IES atlas texture manager.
This persistent atlas hold IES texture in a unique texture array which is used by all systems (raster/RT/PT/Lumen), and unify IES profile rendering.

#rb chris.kulla, sebastien.hillaire, krzysztof.narkowicz
#jira UE-167618
#preflight 6356fd907261e565c436a0fb

[CL 22806455 by Charles deRousiers in ue5-main branch]
2022-10-27 04:36:31 -04:00

52 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "RHIDefinitions.h"
#include "RenderGraphDefinitions.h"
class FRHITexture;
class UTexture;
class FViewInfo;
namespace RectLightAtlas
{
// Atlas slot description in terms of UV coordinates
struct FAtlasSlotDesc
{
FVector2f UVOffset;
FVector2f UVScale;
float MaxMipLevel;
};
// Add a rect light source texture to the atlas
RENDERER_API uint32 AddTexture(UTexture* Texture);
// Remove a rect light source texture from the atlas
RENDERER_API void RemoveTexture(uint32 InSlotId);
// Return the atlas coordinate for a particular slot
RENDERER_API FAtlasSlotDesc GetAtlasSlot(uint32 InSlotId);
// Return the atlas texture
RENDERER_API FRHITexture* GetAtlasTexture();
// Update the rect light atlas texture
RENDERER_API void UpdateAtlasTexture(FRDGBuilder& GraphBuilder, const ERHIFeatureLevel::Type FeatureLevel);
// Return the rect light atlas debug pass
RENDERER_API void AddDebugPass(FRDGBuilder& GraphBuilder, const FViewInfo& View, FRDGTextureRef OutputTexture);
// Scope for invalidating a particular texture
// This ensures the atlas contains the latest version of the texture and filter it
struct FAtlasTextureInvalidationScope
{
FAtlasTextureInvalidationScope(UTexture* In);
~FAtlasTextureInvalidationScope();
FAtlasTextureInvalidationScope(const FAtlasTextureInvalidationScope&) = delete;
FAtlasTextureInvalidationScope& operator=(const FAtlasTextureInvalidationScope&) = delete;
UTexture* Texture = nullptr;
};
}