vault backup: 2024-05-15 11:23:47
This commit is contained in:
parent
5a48907043
commit
d211d5c69a
@ -6,5 +6,58 @@
|
||||
|
||||
# 移植到官方引擎
|
||||
1. 替换修改的引擎usf文件。
|
||||
2. 移除ToneMapping.usf中的修改部分。
|
||||
1. `tonemapping那里多加了一张图,从c++加的`
|
||||
2. 移除PostProcessTonemap.usf中的修改部分。
|
||||
1. `tonemapping那里多加了一张图,从c++加的`
|
||||
|
||||
```hlsl
|
||||
void MainPS(
|
||||
in noperspective float2 UV : TEXCOORD0,
|
||||
in noperspective float2 InVignette : TEXCOORD1,
|
||||
in noperspective float4 GrainUV : TEXCOORD2,
|
||||
in noperspective float2 ScreenPos : TEXCOORD3,
|
||||
in noperspective float2 FullViewUV : TEXCOORD4,
|
||||
float4 SvPosition : SV_POSITION, // after all interpolators
|
||||
out float4 OutColor : SV_Target0
|
||||
#if OUTPUT_LUMINANCE
|
||||
, out float OutLuminance: SV_Target1
|
||||
#endif
|
||||
)
|
||||
{
|
||||
float Luminance;
|
||||
FGBufferData SamplerBuffer = GetGBufferData(UV * View.ResolutionFractionAndInv.x, false);
|
||||
if (SamplerBuffer.CustomStencil > 1.0f && abs(SamplerBuffer.CustomDepth - SamplerBuffer.Depth) < 1)
|
||||
{
|
||||
OutColor = SampleSceneColor(UV);
|
||||
}
|
||||
else
|
||||
{
|
||||
OutColor = TonemapCommonPS(UV, InVignette, GrainUV, ScreenPos, FullViewUV, SvPosition, Luminance);
|
||||
}
|
||||
#if OUTPUT_LUMINANCE
|
||||
OutLuminance = Luminance;
|
||||
#endif
|
||||
}
|
||||
```
|
||||
还原成原本样式:
|
||||
```
|
||||
void MainPS(
|
||||
in noperspective float2 UV : TEXCOORD0,
|
||||
in noperspective float2 InVignette : TEXCOORD1,
|
||||
in noperspective float4 GrainUV : TEXCOORD2,
|
||||
in noperspective float2 ScreenPos : TEXCOORD3,
|
||||
in noperspective float2 FullViewUV : TEXCOORD4,
|
||||
float4 SvPosition : SV_POSITION, // after all interpolators
|
||||
out float4 OutColor : SV_Target0
|
||||
#if OUTPUT_LUMINANCE
|
||||
, out float OutLuminance: SV_Target1
|
||||
#endif
|
||||
)
|
||||
{
|
||||
float Luminance;
|
||||
FGBufferData SamplerBuffer = GetGBufferData(UV * View.ResolutionFractionAndInv.x, false);
|
||||
OutColor = TonemapCommonPS(UV, InVignette, GrainUV, ScreenPos, FullViewUV, SvPosition, Luminance);
|
||||
#if OUTPUT_LUMINANCE
|
||||
OutLuminance = Luminance;
|
||||
#endif
|
||||
}
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user