vault backup: 2024-09-06 18:59:17

This commit is contained in:
BlueRose 2024-09-06 18:59:17 +08:00
parent b20bc2dba3
commit c2cd14cb04

View File

@ -30,3 +30,62 @@
2. 人工检查。
3. ~~P4 Shelf协作方法测试。~~ 理论可行,但字节并没有使用这种方式。
4. 之后大活的实现方式。新建大地图,需要的场景手动移植到新的大地图。
```c++
/** Adds a render graph pass to copy a region from one texture to another. Uses RHICopyTexture under the hood.
* Formats of the two textures must match. The output and output texture regions be within the respective extents.
*/
RENDERCORE_API void AddCopyTexturePass(
FRDGBuilder& GraphBuilder,
FRDGTextureRef InputTexture,
FRDGTextureRef OutputTexture,
const FRHICopyTextureInfo& CopyInfo);
/** Simpler variant of the above function for 2D textures.
* @param InputPosition The pixel position within the input texture of the top-left corner of the box.
* @param OutputPosition The pixel position within the output texture of the top-left corner of the box.
* @param Size The size in pixels of the region to copy from input to output. If zero, the full extent of
* the input texture is copied.
*/
inline void AddCopyTexturePass(
FRDGBuilder& GraphBuilder,
FRDGTextureRef InputTexture,
FRDGTextureRef OutputTexture,
FIntPoint InputPosition = FIntPoint::ZeroValue,
FIntPoint OutputPosition = FIntPoint::ZeroValue,
FIntPoint Size = FIntPoint::ZeroValue)
{
FRHICopyTextureInfo CopyInfo;
CopyInfo.SourcePosition.X = InputPosition.X;
CopyInfo.SourcePosition.Y = InputPosition.Y;
CopyInfo.DestPosition.X = OutputPosition.X;
CopyInfo.DestPosition.Y = OutputPosition.Y;
if (Size != FIntPoint::ZeroValue)
{
CopyInfo.Size = FIntVector(Size.X, Size.Y, 1);
}
AddCopyTexturePass(GraphBuilder, InputTexture, OutputTexture, CopyInfo);
}
```
SSR:
SHADER_PARAMETER_RDG_TEXTURE_SRV(Texture2D, SceneColor)
```c++
FRDGTextureSRVRef InputColor = GraphBuilder.CreateSRV(FRDGTextureSRVDesc(CurrentSceneColor));
if (SSRQuality != ESSRQuality::VisualizeSSR)
{
if (View.PrevViewInfo.CustomSSRInput.IsValid())
{ InputColor = GraphBuilder.CreateSRV(FRDGTextureSRVDesc(
GraphBuilder.RegisterExternalTexture(View.PrevViewInfo.CustomSSRInput.RT[0])));
} else if (GSSRHalfResSceneColor && View.PrevViewInfo.HalfResTemporalAAHistory.IsValid())
{ InputColor = GraphBuilder.CreateSRV(FRDGTextureSRVDesc(
GraphBuilder.RegisterExternalTexture(View.PrevViewInfo.HalfResTemporalAAHistory)));
} else if (View.PrevViewInfo.TemporalAAHistory.IsValid())
{ FRDGTextureRef TemporalAAHistoryTexture = GraphBuilder.RegisterExternalTexture(View.PrevViewInfo.TemporalAAHistory.RT[0]);
InputColor = GraphBuilder.CreateSRV(TemporalAAHistoryTexture->Desc.IsTextureArray()
? FRDGTextureSRVDesc::CreateForSlice(TemporalAAHistoryTexture, View.PrevViewInfo.TemporalAAHistory.OutputSliceIndex)
: FRDGTextureSRVDesc(TemporalAAHistoryTexture));
}}
```