vault backup: 2025-04-11 23:10:07
This commit is contained in:
parent
e93f9d7643
commit
c1b61e6352
.obsidian/plugins/various-complements
03-UnrealEngine/卡通渲染相关资料/渲染功能/PostProcess
@ -1 +1 @@
|
||||
{"和blender共同制作,山脉为":{"和blender共同制作,山脉为":{"currentFile":{"count":1,"lastUpdated":1741610747166}}},"BlueprintCosmetic":{"BlueprintCosmetic":{"internalLink":{"count":1,"lastUpdated":1741951657866}}},"ReflectionsColor":{"ReflectionsColor":{"currentFile":{"count":1,"lastUpdated":1742739458164}}},"主要执行了:":{"主要执行了:":{"currentFile":{"count":1,"lastUpdated":1742830096172}}},"尝试平滑Lumen中的SH。":{"尝试平滑Lumen中的SH。":{"currentFile":{"count":1,"lastUpdated":1742910977705}}},"SupportDynamicSliderMinValue":{"SupportDynamicSliderMinValue":{"internalLink":{"count":1,"lastUpdated":1743066829865}}},"4DGaussians":{"4DGaussians":{"internalLink":{"count":1,"lastUpdated":1743173207988}}},"DMX灯光优化:":{"DMX灯光优化:":{"currentFile":{"count":1,"lastUpdated":1743327201208}}},"Addtivte":{"Addtivte":{"currentFile":{"count":1,"lastUpdated":1743329217204}}},"Dual-Ego":{"Dual-Ego":{"currentFile":{"count":1,"lastUpdated":1743338268824}}},"Merge、":{"Merge、":{"currentFile":{"count":1,"lastUpdated":1743339455484}}},"Nightglow":{"Nightglow":{"currentFile":{"count":1,"lastUpdated":1743341217248}}},"Nanite":{"Nanite":{"currentFile":{"count":1,"lastUpdated":1743344181589}}},"另一个位更加偏向于虚拟偶像直播,主要负责:":{"另一个位更加偏向于虚拟偶像直播,主要负责:":{"currentFile":{"count":1,"lastUpdated":1743396187936}}},"角色换装&道具:":{"角色换装&道具:":{"currentFile":{"count":1,"lastUpdated":1743405142805}}},"Dynamics),主要用于模拟布料以及刚体(头发)。":{"Dynamics),主要用于模拟布料以及刚体(头发)。":{"currentFile":{"count":1,"lastUpdated":1743413286078}}},"主要解决了:":{"主要解决了:":{"currentFile":{"count":1,"lastUpdated":1743413294305}}},"日常问题解决":{"日常问题解决":{"currentFile":{"count":1,"lastUpdated":1743426012684}}},"每章节解锁新的解谜道具增加了可玩性深度:":{"每章节解锁新的解谜道具增加了可玩性深度:":{"currentFile":{"count":1,"lastUpdated":1743665897310}}}}
|
||||
{"BlueprintCosmetic":{"BlueprintCosmetic":{"internalLink":{"count":1,"lastUpdated":1741951657866}}},"ReflectionsColor":{"ReflectionsColor":{"currentFile":{"count":1,"lastUpdated":1742739458164}}},"主要执行了:":{"主要执行了:":{"currentFile":{"count":1,"lastUpdated":1742830096172}}},"尝试平滑Lumen中的SH。":{"尝试平滑Lumen中的SH。":{"currentFile":{"count":1,"lastUpdated":1742910977705}}},"SupportDynamicSliderMinValue":{"SupportDynamicSliderMinValue":{"internalLink":{"count":1,"lastUpdated":1743066829865}}},"4DGaussians":{"4DGaussians":{"internalLink":{"count":1,"lastUpdated":1743173207988}}},"DMX灯光优化:":{"DMX灯光优化:":{"currentFile":{"count":1,"lastUpdated":1743327201208}}},"Addtivte":{"Addtivte":{"currentFile":{"count":1,"lastUpdated":1743329217204}}},"Dual-Ego":{"Dual-Ego":{"currentFile":{"count":1,"lastUpdated":1743338268824}}},"Merge、":{"Merge、":{"currentFile":{"count":1,"lastUpdated":1743339455484}}},"Nightglow":{"Nightglow":{"currentFile":{"count":1,"lastUpdated":1743341217248}}},"Nanite":{"Nanite":{"currentFile":{"count":1,"lastUpdated":1743344181589}}},"另一个位更加偏向于虚拟偶像直播,主要负责:":{"另一个位更加偏向于虚拟偶像直播,主要负责:":{"currentFile":{"count":1,"lastUpdated":1743396187936}}},"角色换装&道具:":{"角色换装&道具:":{"currentFile":{"count":1,"lastUpdated":1743405142805}}},"Dynamics),主要用于模拟布料以及刚体(头发)。":{"Dynamics),主要用于模拟布料以及刚体(头发)。":{"currentFile":{"count":1,"lastUpdated":1743413286078}}},"主要解决了:":{"主要解决了:":{"currentFile":{"count":1,"lastUpdated":1743413294305}}},"日常问题解决":{"日常问题解决":{"currentFile":{"count":1,"lastUpdated":1743426012684}}},"每章节解锁新的解谜道具增加了可玩性深度:":{"每章节解锁新的解谜道具增加了可玩性深度:":{"currentFile":{"count":1,"lastUpdated":1743665897310}}},"之后,这部分抓取参考场景的颜色值,将它们转换为参考显示。":{"之后,这部分抓取参考场景的颜色值,将它们转换为参考显示。":{"currentFile":{"count":1,"lastUpdated":1744380033457}}}}
|
@ -373,10 +373,65 @@ float3 ToneMappedColorAP1 = FilmToneMap( ColorAP1 );
|
||||
- UE4中添加自定义ComputerShader:https://zhuanlan.zhihu.com/p/413884878
|
||||
- UE渲染学习(2)- 自定义PostProcess - Kuwahara滤镜:https://zhuanlan.zhihu.com/p/25790491262
|
||||
|
||||
# 添加
|
||||
# 在if(bPostProcessingEnabled)代码段
|
||||
1. 在AddPostProcessingPasses()(PostProcessing.cpp)中的**EPass**与**PassNames**数组中添加Pass名称枚举与Pass名称字符串。
|
||||
2. 在**PassSequence.Finalize()** 之前添加
|
||||
2. 在**PassSequence.Finalize()** 之前,添加上一步EPass同名的`PassSequence.SetEnabled(EPass::XXX)` 。该逻辑用于控制对应Pass是否起作用。
|
||||
3. 根据步骤1中新增Pass的顺序,在对应的位置添加对应的代码段。额外需要注意的Tonemap前后的Pass代码有所不同。
|
||||
|
||||
## Pass代码
|
||||
1. `MotionBlur`之前(后处理材质BL_BeforeTonemapping之前),传入FScreenPassTexture SceneColor进行绘制。
|
||||
2. `MotionBlur`~`Tonemap`传入FScreenPassTextureSlice SceneColorSlice进行绘制。
|
||||
3. `Tonemap`之后,传入FScreenPassTexture SceneColor进行绘制。
|
||||
|
||||
`MotionBlur`~`Tonemap`大致这么写:
|
||||
```c++
|
||||
if (PassSequence.IsEnabled(EPass::XXX))
|
||||
{
|
||||
FXXXInputs PassInputs;
|
||||
PassSequence.AcceptOverrideIfLastPass(EPass::XXX, PassInputs.OverrideOutput);
|
||||
PassInputs.SceneColorSlice = SceneColorSlice;
|
||||
|
||||
SceneColorSlice = FScreenPassTextureSlice::CreateFromScreenPassTexture(GraphBuilder, AddXXXPass(GraphBuilder, View, PassInputs));
|
||||
}
|
||||
```
|
||||
|
||||
其他位置大致这么写:
|
||||
```c++
|
||||
if (PassSequence.IsEnabled(EPass::XXX))
|
||||
{
|
||||
FXXXInputs PassInputs;
|
||||
PassSequence.AcceptOverrideIfLastPass(EPass::XXX, PassInputs.OverrideOutput);
|
||||
PassInputs.SceneColor = SceneColor;
|
||||
|
||||
SceneColor = AddXXXPass(GraphBuilder, View, PassInputs);
|
||||
}
|
||||
```
|
||||
|
||||
## 超采样之后的UV转换
|
||||
`Tonemap`之后的Pass因为超采样的关系使得ViewportResoution与BufferResoution不同,所以需要使用`SHADER_PARAMETER(FScreenTransform, SvPositionToInputTextureUV)`以及`FScreenTransform::ChangeTextureBasisFromTo`计算变换比例。具体可以参考FFXAAPS。
|
||||
|
||||
|
||||
|
||||
# 在else代码段
|
||||
在else代码段中添加新Pass禁用代码段。不添加则会在切换到其他View(比如材质编辑器的Preview)时崩溃。例如:
|
||||
```c++
|
||||
if(bPostProcessingEnabled){
|
||||
...
|
||||
...
|
||||
}else
|
||||
{
|
||||
PassSequence.SetEnabled(EPass::XXX, false);
|
||||
|
||||
PassSequence.SetEnabled(EPass::MotionBlur, false);
|
||||
PassSequence.SetEnabled(EPass::Tonemap, true);
|
||||
PassSequence.SetEnabled(EPass::FXAA, false);
|
||||
PassSequence.SetEnabled(EPass::PostProcessMaterialAfterTonemapping, false);
|
||||
PassSequence.SetEnabled(EPass::VisualizeDepthOfField, false);
|
||||
PassSequence.SetEnabled(EPass::VisualizeLocalExposure, false);
|
||||
PassSequence.Finalize();
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
##
|
||||
PS:
|
||||
|
Loading…
x
Reference in New Issue
Block a user