vault backup: 2024-10-01 22:52:27

This commit is contained in:
BlueRose 2024-10-01 22:52:27 +08:00
parent 44ba312e86
commit 0ff0fdfbce
2 changed files with 35 additions and 7 deletions

View File

@ -1 +1 @@
{"婚礼布置2W。老妈去谈。":{"婚礼布置2W。老妈去谈。":{"currentFile":{"count":1,"lastUpdated":1725803390742}}},"如下所示:":{"如下所示:":{"currentFile":{"count":1,"lastUpdated":1725940732272}}},"剩下8通道":{"剩下8通道":{"currentFile":{"count":1,"lastUpdated":1726629297275}}},"根据bComputeExport分别使用RDG的ComputeShader与PixelShader输出DepthStencil。":{"根据bComputeExport分别使用RDG的ComputeShader与PixelShader输出DepthStencil。":{"currentFile":{"count":1,"lastUpdated":1727249472660}}},"MeshDraw":{"MeshDraw":{"internalLink":{"count":1,"lastUpdated":1727260163677}}}}
{"582020846":{"582020846":{"currentFile":{"count":1,"lastUpdated":1727792069567}}},"婚礼布置2W。老妈去谈。":{"婚礼布置2W。老妈去谈。":{"currentFile":{"count":1,"lastUpdated":1725803390742}}},"如下所示:":{"如下所示:":{"currentFile":{"count":1,"lastUpdated":1725940732272}}},"剩下8通道":{"剩下8通道":{"currentFile":{"count":1,"lastUpdated":1726629297275}}},"根据bComputeExport分别使用RDG的ComputeShader与PixelShader输出DepthStencil。":{"根据bComputeExport分别使用RDG的ComputeShader与PixelShader输出DepthStencil。":{"currentFile":{"count":1,"lastUpdated":1727249472660}}},"MeshDraw":{"MeshDraw":{"internalLink":{"count":1,"lastUpdated":1727260163677}}}}

View File

@ -31,10 +31,38 @@ PS.使用的Shader必须是`FNaniteGlobalShader`的子类。
该函数在FDeferredShadingSceneRenderer::RenderBasePassInternal()中调用。
DrawNaniteMaterialPass() => SubmitNaniteIndirectMaterial()
## DepthStencil
***TStaticDepthStencilState***
## PSO
- RDG 04 Graphics Pipeline State Initializer https://zhuanlan.zhihu.com/p/582020846
- FGraphicsPipelineStateInitializer
- FRHIDepthStencilState* DepthStencilState
- FRHIBlendState* BlendState
- FRHIRasterizerState* RasterizerState
- EPrimitiveType PrimitiveType
- FBoundShaderStateInput BoundShaderState.VertexDeclarationRHI
- FBoundShaderStateInput BoundShaderState.VertexShaderRHI
- FBoundShaderStateInput BoundShaderState.PixelShaderRHI
- ……
// 应用
SetGraphicsPipelineState(RHICmdList, GraphicsPSOInit,0);
## FMeshPassProcessorRenderState
- FMeshPassProcessorRenderState
- FRHIBlendState* BlendState
- FRHIDepthStencilState* DepthStencilState
- FExclusiveDepthStencil::Type DepthStencilAccess
- FRHIUniformBuffer* ViewUniformBuffer
- FRHIUniformBuffer* InstancedViewUniformBuffer
- FRHIUniformBuffer* PassUniformBuffer
- FRHIUniformBuffer* NaniteUniformBuffer
- uint32 StencilRef = 0;
### FRHIBlendState
### FRHIDepthStencilState
***TStaticDepthStencilState***
```c++
DrawRenderState.SetDepthStencilState(TStaticDepthStencilState<false, CF_Equal>::GetRHI());
@ -99,7 +127,8 @@ void SetDepthStencilStateForBasePass(
}
```
### InitCustomDepthStencilContext()
### CustomStencil
#### InitCustomDepthStencilContext()
根据当前平台是否支持使用ComputeShader直接输出结果bComputeExport、以及是否写入Stencil缓存以此来创建不同的资源。最终输出FCustomDepthContext。
```c++
struct FCustomDepthContext
@ -112,7 +141,7 @@ struct FCustomDepthContext
};
```
### EmitCustomDepthStencilTargets()
#### EmitCustomDepthStencilTargets()
根据bComputeExport分别使用RDG的ComputeShader与PixelShader输出DepthStencil。
- CS使用FComputeShaderUtils::AddPass()
- PS使用NaniteExportGBuffer.usf的**EmitCustomDepthStencilPS()**FPixelShaderUtils::AddFullscreenPass()
@ -125,10 +154,9 @@ struct FCustomDepthContext
- Texture2D`<`UlongType`>`, VisBuffer64
- ByteAddressBuffer MaterialSlotTable
### FinalizeCustomDepthStencil()
#### FinalizeCustomDepthStencil()
替换输出的Depth&Stencil。
# FViewInfo
FViewInfo& ViewInfo
- WriteView.bSceneHasSkyMaterial |= bSceneHasSkyMaterial;