--- title: Untitled date: 2024-09-26 18:41:24 excerpt: tags: rating: ⭐ --- # SetDepthStencilStateForBasePass() ```c++ void SetDepthStencilStateForBasePass( FMeshPassProcessorRenderState& DrawRenderState, ERHIFeatureLevel::Type FeatureLevel, bool bDitheredLODTransition, const FMaterial& MaterialResource, bool bEnableReceiveDecalOutput, bool bForceEnableStencilDitherState) { const bool bMaskedInEarlyPass = (MaterialResource.IsMasked() || bDitheredLODTransition) && MaskedInEarlyPass(GShaderPlatformForFeatureLevel[FeatureLevel]); if (bEnableReceiveDecalOutput) { if (bMaskedInEarlyPass) { SetDepthStencilStateForBasePass_Internal(DrawRenderState, FeatureLevel); } else if (DrawRenderState.GetDepthStencilAccess() & FExclusiveDepthStencil::DepthWrite) { SetDepthStencilStateForBasePass_Internal(DrawRenderState, FeatureLevel); } else { SetDepthStencilStateForBasePass_Internal(DrawRenderState, FeatureLevel); } } else if (bMaskedInEarlyPass) { DrawRenderState.SetDepthStencilState(TStaticDepthStencilState::GetRHI()); } if (bForceEnableStencilDitherState) { SetDepthStencilStateForBasePass_Internal(DrawRenderState, FeatureLevel); } } ``` #