mirror of
https://github.com/celisej567/cool-source-archive.git
synced 2026-09-15 20:09:19 +03:00
49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
// DYNAMIC: "PIXELFOGTYPE" "0..0"
|
|
|
|
// STATIC: "CONVERT_TO_SRGB" "0..1" [ps20b][= g_pHardwareConfig->NeedsShaderSRGBConversion()]
|
|
|
|
#include "common_ps_fxc.h"
|
|
|
|
Texture2D YTexture : register(t0);
|
|
SamplerState YSampler : register( s0 );
|
|
|
|
Texture2D cRTexture : register(t1);
|
|
SamplerState cRSampler : register( s1 );
|
|
|
|
Texture2D cBTexture : register(t2);
|
|
SamplerState cBSampler : register( s2 );
|
|
|
|
struct PS_INPUT
|
|
{
|
|
HALF2 baseTexCoord : TEXCOORD0;
|
|
//HALF4 worldPos_projPosZ : TEXCOORD1;
|
|
//float4 fogFactorW : COLOR1;
|
|
};
|
|
|
|
float4 main( PS_INPUT i ) : SV_TARGET
|
|
{
|
|
half y, cR, cB;
|
|
y = YTexture.Sample( YSampler, i.baseTexCoord.xy );
|
|
cR = cRTexture.Sample( cRSampler, i.baseTexCoord.xy );
|
|
cB = cBTexture.Sample( cBSampler, i.baseTexCoord.xy );
|
|
|
|
HALF4 c;
|
|
c = float4( y, cR, cB, 1.0f );
|
|
|
|
float4 tor = float4( 1.164123535f, 1.595794678f, 0.0f, -0.87065506f );
|
|
float4 tog = float4( 1.164123535f, -0.813476563f, -0.391448975f, 0.529705048f );
|
|
float4 tob = float4( 1.164123535f, 0.0f, 2.017822266f, -1.081668854f );
|
|
|
|
HALF4 rgba;
|
|
|
|
rgba.r = dot( c, tor );
|
|
rgba.g = dot( c, tog );
|
|
rgba.b = dot( c, tob );
|
|
rgba.a = 1.0f;
|
|
|
|
//float fogFactor = CalcPixelFogFactor( PIXELFOGTYPE, g_FogParams, g_EyePos_SpecExponent.z, i.worldPos_projPosZ.z, i.worldPos_projPosZ.w );
|
|
float4 result = rgba;
|
|
|
|
return result;
|
|
}
|