LADXHD/Content/Shader/BlurH.fx

34 lines
853 B
HLSL
Raw Normal View History

2023-12-14 22:21:22 +00:00
#if OPENGL
#define SV_POSITION POSITION
#define VS_SHADERMODEL vs_3_0
#define PS_SHADERMODEL ps_3_0
#else
#define VS_SHADERMODEL vs_4_0_level_9_1
#define PS_SHADERMODEL ps_4_0_level_9_1
#endif
sampler s0;
float pixelX;
float mult0;
float mult1;
float4 PixelShaderFunction(float4 pos : SV_Position, float4 color1 : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float4 sideColors
= tex2D(s0, float2(coords.x - pixelX * 0.5, coords.y)) * mult0;
sideColors += tex2D(s0, float2(coords.x + pixelX * 0.5, coords.y)) * mult0;
sideColors += tex2D(s0, float2(coords.x - pixelX * 2.5, coords.y)) * mult1;
sideColors += tex2D(s0, float2(coords.x + pixelX * 2.5, coords.y)) * mult1;
return sideColors;
}
technique Technique1
{
pass Pass1
{
PixelShader = compile PS_SHADERMODEL PixelShaderFunction();
}
}