This commit is contained in:
2025-08-02 12:09:34 +08:00
commit e70b01cdca
2785 changed files with 575579 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);
```