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,9 +31,37 @@ PS.使用的Shader必须是`FNaniteGlobalShader`的子类。
该函数在FDeferredShadingSceneRenderer::RenderBasePassInternal()中调用。 该函数在FDeferredShadingSceneRenderer::RenderBasePassInternal()中调用。
DrawNaniteMaterialPass() => SubmitNaniteIndirectMaterial() DrawNaniteMaterialPass() => SubmitNaniteIndirectMaterial()
## DepthStencil ## 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*** ***TStaticDepthStencilState***
- RDG 04 Graphics Pipeline State Initializer https://zhuanlan.zhihu.com/p/582020846
```c++ ```c++
@ -99,7 +127,8 @@ void SetDepthStencilStateForBasePass(
} }
``` ```
### InitCustomDepthStencilContext() ### CustomStencil
#### InitCustomDepthStencilContext()
根据当前平台是否支持使用ComputeShader直接输出结果bComputeExport、以及是否写入Stencil缓存以此来创建不同的资源。最终输出FCustomDepthContext。 根据当前平台是否支持使用ComputeShader直接输出结果bComputeExport、以及是否写入Stencil缓存以此来创建不同的资源。最终输出FCustomDepthContext。
```c++ ```c++
struct FCustomDepthContext struct FCustomDepthContext
@ -112,7 +141,7 @@ struct FCustomDepthContext
}; };
``` ```
### EmitCustomDepthStencilTargets() #### EmitCustomDepthStencilTargets()
根据bComputeExport分别使用RDG的ComputeShader与PixelShader输出DepthStencil。 根据bComputeExport分别使用RDG的ComputeShader与PixelShader输出DepthStencil。
- CS使用FComputeShaderUtils::AddPass() - CS使用FComputeShaderUtils::AddPass()
- PS使用NaniteExportGBuffer.usf的**EmitCustomDepthStencilPS()**FPixelShaderUtils::AddFullscreenPass() - PS使用NaniteExportGBuffer.usf的**EmitCustomDepthStencilPS()**FPixelShaderUtils::AddFullscreenPass()
@ -125,10 +154,9 @@ struct FCustomDepthContext
- Texture2D`<`UlongType`>`, VisBuffer64 - Texture2D`<`UlongType`>`, VisBuffer64
- ByteAddressBuffer MaterialSlotTable - ByteAddressBuffer MaterialSlotTable
### FinalizeCustomDepthStencil() #### FinalizeCustomDepthStencil()
替换输出的Depth&Stencil。 替换输出的Depth&Stencil。
# FViewInfo # FViewInfo
FViewInfo& ViewInfo FViewInfo& ViewInfo
- WriteView.bSceneHasSkyMaterial |= bSceneHasSkyMaterial; - WriteView.bSceneHasSkyMaterial |= bSceneHasSkyMaterial;