You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
106 lines
3.4 KiB
C++
106 lines
3.4 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
VisualizeTexture.h: Post processing visualize texture.
|
|
=============================================================================*/
|
|
|
|
#pragma once
|
|
|
|
class FVisualizeTexture
|
|
{
|
|
public:
|
|
FVisualizeTexture();
|
|
|
|
/** renders the VisualizeTextureContent to the current render target */
|
|
void PresentContent(const FSceneView& View);
|
|
/** */
|
|
void OnStartFrame(const FSceneView& View);
|
|
/** */
|
|
void SetObserveTarget(const FString& InObservedDebugName, uint32 InObservedDebugNameReusedGoal = 0xffffffff);
|
|
// @return 0 if not found
|
|
IPooledRenderTarget* GetObservedElement() const;
|
|
/**
|
|
* calling this allows to grab the state of the texture at this point to be queried by visualizetexture e.g. "vis LightAttenuation@2"
|
|
* @param PooledRenderTarget 0 is silently ignored
|
|
*/
|
|
void SetCheckPoint(const IPooledRenderTarget* PooledRenderTarget);
|
|
|
|
// @param bExtended true: with more convenience - not needed for crashes but useful from the console
|
|
void DebugLog(bool bExtended);
|
|
|
|
void QueryInfo( FQueryVisualizeTexureInfo& Out );
|
|
|
|
// VisualizeTexture console command settings:
|
|
// written on game thread, read on render thread (uses FlushRenderingCommands to avoid the threading issues)
|
|
|
|
// 0=off, >0=texture id, changed by "VisualizeTexture" console command, useful for debugging
|
|
int32 Mode;
|
|
//
|
|
float RGBMul;
|
|
//
|
|
float AMul;
|
|
// 0=view in left top, 1=whole texture, 2=pixel perfect centered, 3=Picture in Picture
|
|
int32 UVInputMapping;
|
|
// bit 1: if 1, saturation mode, if 0, frac mode
|
|
int32 Flags;
|
|
//
|
|
int32 CustomMip;
|
|
//
|
|
int32 ArrayIndex;
|
|
//
|
|
bool bSaveBitmap;
|
|
// stencil normally displays in the alpha channel of depth buffer visualization. This option is just for BMP writeout to get a stencil only BMP.
|
|
bool bOutputStencil;
|
|
//
|
|
bool bFullList;
|
|
// -1:by index, 0:by name, 1:by size
|
|
int32 SortOrder;
|
|
|
|
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
|
|
// [DebugName of the RT] = ReuseCount this frame
|
|
TMap<FString, uint32> VisualizeTextureCheckpoints;
|
|
#endif
|
|
|
|
// render target DebugName that is observed, "" if the feature is deactivated
|
|
FString ObservedDebugName;
|
|
// each frame this is counting up each time a RT with the same name is reused
|
|
uint32 ObservedDebugNameReusedCurrent;
|
|
// this is the count we want to reach, 0xffffffff if the last one
|
|
uint32 ObservedDebugNameReusedGoal;
|
|
|
|
private:
|
|
TRefCountPtr<IPooledRenderTarget> VisualizeTextureContent;
|
|
// only valid/useful if VisualizeTextureContent is set
|
|
FPooledRenderTargetDesc VisualizeTextureDesc;
|
|
TRefCountPtr<FRHIShaderResourceView> StencilSRV;
|
|
FTextureRHIRef StencilSRVSrc;
|
|
|
|
FIntRect ViewRect;
|
|
|
|
// is called by FPooledRenderTarget
|
|
|
|
void GenerateContent(const FSceneRenderTargetItem& RenderTargetItem, const FPooledRenderTargetDesc& Desc);
|
|
|
|
FIntRect ComputeVisualizeTextureRect(FIntPoint InputTextureSize) const;
|
|
};
|
|
|
|
|
|
struct FVisualizeTextureData
|
|
{
|
|
FVisualizeTextureData(const FSceneRenderTargetItem& InRenderTargetItem, const FPooledRenderTargetDesc& InDesc)
|
|
: RenderTargetItem(InRenderTargetItem), Desc(InDesc), StencilSRV(nullptr)
|
|
{
|
|
}
|
|
|
|
const FSceneRenderTargetItem& RenderTargetItem;
|
|
const FPooledRenderTargetDesc& Desc;
|
|
TRefCountPtr<FRHIShaderResourceView> StencilSRV;
|
|
float RGBMul;
|
|
float AMul;
|
|
FVector2D Tex00;
|
|
FVector2D Tex11;
|
|
bool bSaturateInsteadOfFrac;
|
|
int32 InputValueMapping;
|
|
int32 ArrayIndex;
|
|
int32 CustomMip;
|
|
}; |