diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /materialsystem/stdshaders/HDRCombineTo16Bit_ps2x.fxc | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'materialsystem/stdshaders/HDRCombineTo16Bit_ps2x.fxc')
| -rw-r--r-- | materialsystem/stdshaders/HDRCombineTo16Bit_ps2x.fxc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/HDRCombineTo16Bit_ps2x.fxc b/materialsystem/stdshaders/HDRCombineTo16Bit_ps2x.fxc new file mode 100644 index 0000000..ec8cf1b --- /dev/null +++ b/materialsystem/stdshaders/HDRCombineTo16Bit_ps2x.fxc @@ -0,0 +1,25 @@ +// STATIC: "CONVERT_TO_SRGB" "0..1" [ps20b][= g_pHardwareConfig->NeedsShaderSRGBConversion()] [PC] +// STATIC: "CONVERT_TO_SRGB" "0..0" [= 0] [XBOX] + +#define HDRTYPE HDR_TYPE_NONE +#include "common_ps_fxc.h" + +sampler LowSampler : register( s0 ); +sampler HiSampler : register( s1 ); + +struct PS_INPUT +{ + float2 texCoord : TEXCOORD0; +}; + +float4 main( PS_INPUT i ) : COLOR +{ + float4 lowColor = tex2D( LowSampler, i.texCoord ); + float3 hiColor = tex2D( HiSampler, i.texCoord ); + + lowColor.rgb = GammaToLinear( lowColor.rgb ); + hiColor.rgb = GammaToLinear( hiColor.rgb ); + + float4 result = float4( ( 1.0f / MAX_HDR_OVERBRIGHT ) * max( lowColor.xyz, hiColor.xyz * MAX_HDR_OVERBRIGHT ), lowColor.a ); + return FinalOutput( result, 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE ); +} |