From 0aa3e87df7be3c7fef5bce06ea4c01886d3f8a0f Mon Sep 17 00:00:00 2001 From: BlueRose <378100977@qq.com> Date: Fri, 27 Sep 2024 11:52:24 +0800 Subject: [PATCH] vault backup: 2024-09-27 11:52:24 --- .../卡通渲染相关资料/卡通渲染开发总览.md | 9 ++-- .../渲染功能/ShaderModel/BasePass C++.md | 45 +++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 03-UnrealEngine/卡通渲染相关资料/渲染功能/ShaderModel/BasePass C++.md diff --git a/03-UnrealEngine/卡通渲染相关资料/卡通渲染开发总览.md b/03-UnrealEngine/卡通渲染相关资料/卡通渲染开发总览.md index 9352fd8..9798351 100644 --- a/03-UnrealEngine/卡通渲染相关资料/卡通渲染开发总览.md +++ b/03-UnrealEngine/卡通渲染相关资料/卡通渲染开发总览.md @@ -129,6 +129,7 @@ rating: ⭐⭐⭐ 1. ![[星穹铁道中下巴阴影处理.png]] 2. [ ] ToonSDFShadow 1. [ ] TODO: SDF贴图工具? + 3. [ ] ShadowPass https://zhuanlan.zhihu.com/p/619718145 19. [ ] LookDev场景 1. [ ] https://zhuanlan.zhihu.com/p/394608910 20. [ ] 考虑往GBuffer中添加更多数据(考虑Velocity以及SingleLayerWater) @@ -141,12 +142,14 @@ rating: ⭐⭐⭐ 1. 【二次元人物眼睛如何变形?】 https://www.bilibili.com/video/BV14M4m1y71A/?share_source=copy_web&vd_source=fe8142e8e12816535feaeabd6f6cdc8e 1. 原视频 https://www.youtube.com/watch?v=euIyX9v8rvw 2. 眼睛建模 https://youtu.be/s2_7Q2IIvNY?si=fWiYjqcLFXzdeQ-B&t=126 -25. DX11问题修复 +25. 尝试实现Forward+ + 1. BasePass https://zhuanlan.zhihu.com/p/618698467 +26. DX11问题修复 1. [x] ToonOutline SceneColorTexture为空的问题。 **DX11限制,必须CopyTexture** -26. 卡通渲染针对TAA的优化思路 https://zhuanlan.zhihu.com/p/678876237 +27. 卡通渲染针对TAA的优化思路 https://zhuanlan.zhihu.com/p/678876237 1. https://www.bilibili.com/video/BV1BK411v7FY/?spm_id_from=333.788&vd_source=ea6df38502a795b7533aa33b78bf1159 2. https://zhuanlan.zhihu.com/p/20786650 -27. [ ] Unreal Engine 5.4 Scene Extension https://zhuanlan.zhihu.com/p/706268007 +28. [ ] Unreal Engine 5.4 Scene Extension https://zhuanlan.zhihu.com/p/706268007 1. [ ] 通过SceneExtension改进ToonObjectID,这样可以减少对应ToonBuffer的精度来存其他数据。 2. [ ] https://www.bilibili.com/video/BV1fM4m1U7Tp/ diff --git a/03-UnrealEngine/卡通渲染相关资料/渲染功能/ShaderModel/BasePass C++.md b/03-UnrealEngine/卡通渲染相关资料/渲染功能/ShaderModel/BasePass C++.md new file mode 100644 index 0000000..344d3f7 --- /dev/null +++ b/03-UnrealEngine/卡通渲染相关资料/渲染功能/ShaderModel/BasePass C++.md @@ -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(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); + } +} +``` +# \ No newline at end of file