vault backup: 2024-09-27 11:52:24
This commit is contained in:
45
03-UnrealEngine/卡通渲染相关资料/渲染功能/ShaderModel/BasePass C++.md
Normal file
45
03-UnrealEngine/卡通渲染相关资料/渲染功能/ShaderModel/BasePass C++.md
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
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<false, CF_Equal>(DrawRenderState, FeatureLevel);
|
||||
}
|
||||
else if (DrawRenderState.GetDepthStencilAccess() & FExclusiveDepthStencil::DepthWrite)
|
||||
{
|
||||
SetDepthStencilStateForBasePass_Internal<true, CF_GreaterEqual>(DrawRenderState, FeatureLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetDepthStencilStateForBasePass_Internal<false, CF_GreaterEqual>(DrawRenderState, FeatureLevel);
|
||||
}
|
||||
}
|
||||
else if (bMaskedInEarlyPass)
|
||||
{
|
||||
DrawRenderState.SetDepthStencilState(TStaticDepthStencilState<false, CF_Equal>::GetRHI());
|
||||
}
|
||||
|
||||
if (bForceEnableStencilDitherState)
|
||||
{
|
||||
SetDepthStencilStateForBasePass_Internal<false, CF_Equal>(DrawRenderState, FeatureLevel);
|
||||
}
|
||||
}
|
||||
```
|
||||
#
|
Reference in New Issue
Block a user