vault backup: 2025-01-19 22:02:41
This commit is contained in:
parent
8f3501b199
commit
906844a68e
03-UnrealEngine/卡通渲染相关资料/渲染功能/PostProcess
@ -0,0 +1,7 @@
|
||||
---
|
||||
title: Toon ToneMapping
|
||||
date: 2025-01-19 21:02:19
|
||||
excerpt:
|
||||
tags:
|
||||
rating: ⭐
|
||||
---
|
@ -124,4 +124,59 @@ BEGIN_SHADER_PARAMETER_STRUCT(FSceneTextureShaderParameters, ENGINE_API)
|
||||
SHADER_PARAMETER_RDG_UNIFORM_BUFFER(FSceneTextureUniformParameters, SceneTextures)
|
||||
SHADER_PARAMETER_RDG_UNIFORM_BUFFER(FMobileSceneTextureUniformParameters, MobileSceneTextures)
|
||||
END_SHADER_PARAMETER_STRUCT()
|
||||
```
|
||||
```
|
||||
|
||||
|
||||
|
||||
# ToneMapping
|
||||
- UE4/UE5和ACES工作流程:https://zhuanlan.zhihu.com/p/660965710
|
||||
|
||||
TonemapCommon.ush中的FilmToneMap()在CombineLUTsCommon()中调用。其顺序为:
|
||||
1. AddCombineLUTPass() => PostProcessCombineLUTs.usf
|
||||
2. AddTonemapPass() => PostProcessTonemap.usf
|
||||
|
||||
```c++
|
||||
void AddPostProcessingPasses()
|
||||
{
|
||||
...
|
||||
{
|
||||
FRDGTextureRef ColorGradingTexture = nullptr;
|
||||
|
||||
if (bPrimaryView)
|
||||
{
|
||||
ColorGradingTexture = AddCombineLUTPass(GraphBuilder, View);
|
||||
}
|
||||
// We can re-use the color grading texture from the primary view.
|
||||
else if (View.GetTonemappingLUT())
|
||||
{
|
||||
ColorGradingTexture = TryRegisterExternalTexture(GraphBuilder, View.GetTonemappingLUT());
|
||||
}
|
||||
else
|
||||
{
|
||||
const FViewInfo* PrimaryView = static_cast<const FViewInfo*>(View.Family->Views[0]);
|
||||
ColorGradingTexture = TryRegisterExternalTexture(GraphBuilder, PrimaryView->GetTonemappingLUT());
|
||||
}
|
||||
|
||||
FTonemapInputs PassInputs;
|
||||
PassSequence.AcceptOverrideIfLastPass(EPass::Tonemap, PassInputs.OverrideOutput);
|
||||
PassInputs.SceneColor = SceneColorSlice;
|
||||
PassInputs.Bloom = Bloom;
|
||||
PassInputs.SceneColorApplyParamaters = SceneColorApplyParameters;
|
||||
PassInputs.LocalExposureTexture = LocalExposureTexture;
|
||||
PassInputs.BlurredLogLuminanceTexture = LocalExposureBlurredLogLumTexture;
|
||||
PassInputs.LocalExposureParameters = &LocalExposureParameters;
|
||||
PassInputs.EyeAdaptationParameters = &EyeAdaptationParameters;
|
||||
PassInputs.EyeAdaptationBuffer = EyeAdaptationBuffer;
|
||||
PassInputs.ColorGradingTexture = ColorGradingTexture;
|
||||
PassInputs.bWriteAlphaChannel = AntiAliasingMethod == AAM_FXAA || bProcessSceneColorAlpha;
|
||||
PassInputs.bOutputInHDR = bTonemapOutputInHDR;
|
||||
|
||||
SceneColor = AddTonemapPass(GraphBuilder, View, PassInputs);
|
||||
}
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
## PostProcessCombineLUTs.usf
|
||||
|
||||
## PostProcessTonemap.usf
|
Loading…
x
Reference in New Issue
Block a user