File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1
1
#include "shared/cMacros.fxh"
2
2
#include "shared/cGraphics.fxh"
3
+ #include "shared/cTonemap.fxh"
3
4
4
5
/*
5
6
Automatic exposure shader using hardware blending
@@ -129,11 +130,11 @@ float3 PS_Exposure(VS2PS_Quad Input) : SV_TARGET0
129
130
float3 Color1 = ExposedColor.rgb;
130
131
float3 Color2 = lerp (Dot * 2.0 , Color.rgb, Mask * 0.5 );
131
132
132
- return lerp (Color1, Color2, Mask).rgb;
133
+ return lerp (ApplyTonemap ( Color1) , Color2, Mask).rgb;
133
134
}
134
135
else
135
136
{
136
- return ExposedColor;
137
+ return ApplyTonemap ( ExposedColor) ;
137
138
}
138
139
}
139
140
Original file line number Diff line number Diff line change 1
1
#include "shared/cBuffers.fxh"
2
2
#include "shared/cGraphics.fxh"
3
+ #include "shared/cTonemap.fxh"
3
4
4
5
/*
5
6
[Shader Options]
6
7
*/
7
8
8
9
uniform float _Threshold <
10
+ ui_category = "Bloom" ;
9
11
ui_label = "Threshold" ;
10
12
ui_type = "slider" ;
11
13
ui_min = 0.0 ;
12
14
ui_max = 1.0 ;
13
15
> = 0.8 ;
14
16
15
17
uniform float _Smooth <
18
+ ui_category = "Bloom" ;
16
19
ui_label = "Smoothing" ;
17
20
ui_type = "slider" ;
18
21
ui_min = 0.0 ;
19
22
ui_max = 1.0 ;
20
23
> = 0.5 ;
21
24
22
25
uniform float _Saturation <
26
+ ui_category = "Bloom" ;
23
27
ui_label = "Saturation" ;
24
28
ui_type = "slider" ;
25
29
ui_min = 0.0 ;
26
30
ui_max = 10.0 ;
27
31
> = 1.0 ;
28
32
29
33
uniform float3 _ColorShift <
34
+ ui_category = "Bloom" ;
30
35
ui_label = "Color Shift (RGB)" ;
31
36
ui_type = "color" ;
32
37
ui_min = 0.0 ;
33
38
ui_max = 1.0 ;
34
39
> = 1.0 ;
35
40
36
41
uniform float _Intensity <
42
+ ui_category = "Bloom" ;
37
43
ui_label = "Intensity" ;
38
44
ui_type = "slider" ;
39
45
ui_min = 0.0 ;
@@ -275,7 +281,7 @@ float4 PS_Composite(VS2PS_Quad Input) : SV_TARGET0
275
281
float3 BloomColor = tex2D (SampleTempTex1, Input.Tex0).rgb;
276
282
277
283
float4 Color = 1.0 ;
278
- Color.rgb = ToneMapACESFilmic (BaseColor + (BloomColor * _Intensity));
284
+ Color.rgb = ApplyTonemap (BaseColor + (BloomColor * _Intensity));
279
285
return Color;
280
286
}
281
287
Original file line number Diff line number Diff line change 80
80
return 0.5 * (D * SDR - sqrt (((D*D - 4.0 *C*E) * SDR + 4.0 *A*E-2.0 *B*D) * SDR + B*B) - B) / (A - C * SDR);
81
81
}
82
82
83
+ uniform int _OutputTonemapOperator <
84
+ ui_category = "OUTPUT" ;
85
+ ui_label = "Tonemap Operator" ;
86
+ ui_tooltip = "Select a tonemap operator for the output" ;
87
+ ui_type = "combo" ;
88
+ ui_items = "Reinhard\0 DirectX Graphics Sample\0 ACES Filmic Approximation\0 " ;
89
+ > = 0 ;
90
+
91
+ float3 ApplyTonemap (float3 HDR)
92
+ {
93
+ switch (_OutputTonemapOperator)
94
+ {
95
+ case 0 :
96
+ return ApplyReinhardTonemap (HDR, 1.0 );
97
+ case 1 :
98
+ return ApplyNewToneMap (HDR);
99
+ case 2 :
100
+ return ApplyToneMapACES (HDR);
101
+ default :
102
+ return HDR;
103
+ }
104
+ }
105
+
83
106
#endif
You can’t perform that action at this time.
0 commit comments