diff --git a/.obsidian/plugins/various-complements/histories.json b/.obsidian/plugins/various-complements/histories.json index 8bcd17d..6ccb1a1 100644 --- a/.obsidian/plugins/various-complements/histories.json +++ b/.obsidian/plugins/various-complements/histories.json @@ -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}}}} \ No newline at end of file +{"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}}}} \ No newline at end of file diff --git a/03-UnrealEngine/Rendering/RenderingPipeline/Materials/MeshDraw.md b/03-UnrealEngine/Rendering/RenderingPipeline/Materials/MeshDraw.md index 683da3a..6cf3605 100644 --- a/03-UnrealEngine/Rendering/RenderingPipeline/Materials/MeshDraw.md +++ b/03-UnrealEngine/Rendering/RenderingPipeline/Materials/MeshDraw.md @@ -31,9 +31,37 @@ PS.使用的Shader必须是`FNaniteGlobalShader`的子类。 该函数在FDeferredShadingSceneRenderer::RenderBasePassInternal()中调用。 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*** -- RDG 04 Graphics Pipeline State Initializer https://zhuanlan.zhihu.com/p/582020846 + ```c++ @@ -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;