This commit is contained in:
2023-06-29 11:55:02 +08:00
commit 36e95249b1
1236 changed files with 464197 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
---
title: 给Pass传入SceneColor
date: 2022-10-10 15:11:46
excerpt:
tags: Rendering
rating: ⭐
---
## 添加变量
```c++
SHADER_PARAMETER_RDG_TEXTURE(Texture2D, SceneColorTexture)
SHADER_PARAMETER_SAMPLER(SamplerState, SceneColorTextureSampler)
```
传入变量
```c++
PassParameters->SceneColorTexture = SceneColorTexture.Target;
PassParameters->SceneColorTextureSampler = TStaticSamplerState<>::GetRHI();
```
## Shader
```c++
Texture2D       SceneColorTexture;
SamplerState    SceneColorTextureSampler;
```
```c++
float4 SceneColor = SceneColorTexture.SampleLevel(SceneColorTextureSampler, SceneBufferUV, 0);
```