55#define PS_HDR 0
66#endif
77
8+ #if PS_HDR
9+ //#define NEUTRAL_ALPHA 127.5f
10+ #define NEUTRAL_ALPHA 128.0f
11+ #else
12+ #define NEUTRAL_ALPHA 128.0f
13+ #endif
14+
815struct VS_INPUT
916{
1017 float4 p : POSITION ;
@@ -147,6 +154,7 @@ PS_OUTPUT ps_datm1_rta_correction(PS_INPUT input)
147154 return output;
148155}
149156
157+ //TODO: these in HDR?
150158PS_OUTPUT ps_datm0_rta_correction (PS_INPUT input)
151159{
152160 PS_OUTPUT output;
@@ -162,21 +170,29 @@ PS_OUTPUT ps_rta_correction(PS_INPUT input)
162170{
163171 PS_OUTPUT output;
164172 float4 value = sample_c (input.t);
165- #if 1 //TODO: saturate this and the above+below ones too? I was suggested to not to
173+ #if PS_HDR && 0 //TODO: saturate this and the above+below ones too? I was suggested to not to. Anyway this is not needed until proven otherwise.
166174 value.a = saturate (value.a);
167175#endif
168- output.c = float4 (value.rgb, value.a * (255.0f / 128.25f ));
176+ #if PS_HDR
177+ output.c = float4 (value.rgb, value.a * (255.0f / NEUTRAL_ALPHA));
178+ #else
179+ output.c = float4 (value.rgb, value.a * (255.0f / (NEUTRAL_ALPHA + 0.25f )));
180+ #endif
169181 return output;
170182}
171183
172184PS_OUTPUT ps_rta_decorrection (PS_INPUT input)
173185{
174186 PS_OUTPUT output;
175187 float4 value = sample_c (input.t);
176- #if 1
188+ #if PS_HDR && 0
177189 value.a = saturate (value.a);
178190#endif
179- output.c = float4 (value.rgb, value.a * (128.25f / 255.0f ));
191+ #if PS_HDR
192+ output.c = float4 (value.rgb, value.a * (NEUTRAL_ALPHA / 255.0f ));
193+ #else
194+ output.c = float4 (value.rgb, value.a * ((NEUTRAL_ALPHA + 0.25f ) / 255.0f ));
195+ #endif
180196 return output;
181197}
182198
@@ -477,6 +493,7 @@ PS_OUTPUT ps_yuv(PS_INPUT input)
477493 return output;
478494}
479495
496+ //TODO: these in HDR?
480497float ps_stencil_image_init_0 (PS_INPUT input) : SV_Target
481498{
482499 float c;
@@ -497,6 +514,7 @@ float ps_stencil_image_init_1(PS_INPUT input) : SV_Target
497514 return c;
498515}
499516
517+ //TODO: these in HDR?
500518float ps_stencil_image_init_2 (PS_INPUT input)
501519 : SV_Target
502520{
0 commit comments