--- title: Untitled date: 2024-10-16 14:39:40 excerpt: tags: rating: ⭐ --- # 前言 # Stencil相关 BasePass:绘制Stencil => CopyStencilToLightingChannels => ClearStencil (SceneDepthZ) :清空深度缓存中的Stencil ## BasePass BasePass中进行LIGHTING_CHANNELS、DISTANCE_FIELD_REPRESENTATION、贴花方面的Mask Bit计算,设置到深度缓存的Stencil上。 ```c++ template void SetDepthStencilStateForBasePass_Internal(FMeshPassProcessorRenderState& InDrawRenderState, ERHIFeatureLevel::Type FeatureLevel) { const static bool bStrataDufferPassEnabled = Strata::IsStrataEnabled() && Strata::IsDBufferPassEnabled(GShaderPlatformForFeatureLevel[FeatureLevel]); if (bStrataDufferPassEnabled) { SetDepthStencilStateForBasePass_Internal(InDrawRenderState); } else { SetDepthStencilStateForBasePass_Internal(InDrawRenderState); } } ```