Init
This commit is contained in:
28
03-UnrealEngine/Rendering/Shader/给Pass传入SceneColor.md
Normal file
28
03-UnrealEngine/Rendering/Shader/给Pass传入SceneColor.md
Normal 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);
|
||||
```
|
Reference in New Issue
Block a user