vault backup: 2025-03-04 22:13:10
This commit is contained in:
parent
ded5a24e04
commit
e7d2b29cb2
@ -393,4 +393,30 @@ FScreenPassTextureSlice SceneColorSlice = FScreenPassTextureSlice::CreateFromScr
|
|||||||
将渲染结果转换成`FScreenPassTextureSlice`:
|
将渲染结果转换成`FScreenPassTextureSlice`:
|
||||||
```c++
|
```c++
|
||||||
SceneColorSlice = FScreenPassTextureSlice::CreateFromScreenPassTexture(GraphBuilder, AddToonPostProcessBeforeTonemappingPass(GraphBuilder, View, PassInputs));
|
SceneColorSlice = FScreenPassTextureSlice::CreateFromScreenPassTexture(GraphBuilder, AddToonPostProcessBeforeTonemappingPass(GraphBuilder, View, PassInputs));
|
||||||
|
```
|
||||||
|
|
||||||
|
```c++
|
||||||
|
// Allows for the scene color to be the slice of an array between temporal upscaler and tonemaper.
|
||||||
|
FScreenPassTextureSlice SceneColorSlice = FScreenPassTextureSlice::CreateFromScreenPassTexture(GraphBuilder, SceneColor);
|
||||||
|
```
|
||||||
|
## Viewport => TextureUV
|
||||||
|
```c++
|
||||||
|
PassParameters->SvPositionToInputTextureUV = (
|
||||||
|
FScreenTransform::SvPositionToViewportUV(Output.ViewRect) *
|
||||||
|
FScreenTransform::ChangeTextureBasisFromTo(FScreenPassTextureViewport(Inputs.SceneColorSlice), FScreenTransform::ETextureBasis::ViewportUV, FScreenTransform::ETextureBasis::TextureUV));
|
||||||
|
```
|
||||||
|
|
||||||
|
在Shader中:
|
||||||
|
```c++
|
||||||
|
Texture2D SceneColorTexture;
|
||||||
|
SamplerState SceneColorSampler;
|
||||||
|
FScreenTransform SvPositionToInputTextureUV;
|
||||||
|
|
||||||
|
void MainPS(
|
||||||
|
float4 SvPosition : SV_POSITION,
|
||||||
|
out float4 OutColor : SV_Target0)
|
||||||
|
{
|
||||||
|
float2 SceneColorUV = ApplyScreenTransform(SvPosition.xy, SvPositionToInputTextureUV);
|
||||||
|
OutColor.rgba = SceneColorTexture.SampleLevel(SceneColorSampler, UV, 0).rgba;
|
||||||
|
}
|
||||||
```
|
```
|
Loading…
x
Reference in New Issue
Block a user