From 3ffa44cef9512974c9039c559806383677c549da Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Wed, 29 Sep 2010 10:10:38 +1000 Subject: [PATCH] Add pixel shaders from the external tarball. byuu has traditionally kept these shaders separately, but I don't see why they shouldn't be stored alongside the code that uses them. Unlike previous versions of pixel shaders, these are updated to use the new file-format introduced in v070r03. --- pixelshaders/GLSL/Curvature.shader | 18 ++++++++ pixelshaders/GLSL/HDR-TV.shader | 21 +++++++++ pixelshaders/GLSL/HQ2x.shader | 73 ++++++++++++++++++++++++++++++ pixelshaders/GLSL/Pixellate.shader | 44 ++++++++++++++++++ pixelshaders/GLSL/Scale2x.shader | 55 ++++++++++++++++++++++ pixelshaders/HLSL/Sepia.shader | 30 ++++++++++++ 6 files changed, 241 insertions(+) create mode 100755 pixelshaders/GLSL/Curvature.shader create mode 100755 pixelshaders/GLSL/HDR-TV.shader create mode 100755 pixelshaders/GLSL/HQ2x.shader create mode 100755 pixelshaders/GLSL/Pixellate.shader create mode 100755 pixelshaders/GLSL/Scale2x.shader create mode 100755 pixelshaders/HLSL/Sepia.shader diff --git a/pixelshaders/GLSL/Curvature.shader b/pixelshaders/GLSL/Curvature.shader new file mode 100755 index 00000000..49abf527 --- /dev/null +++ b/pixelshaders/GLSL/Curvature.shader @@ -0,0 +1,18 @@ + + + + diff --git a/pixelshaders/GLSL/HDR-TV.shader b/pixelshaders/GLSL/HDR-TV.shader new file mode 100755 index 00000000..137bedba --- /dev/null +++ b/pixelshaders/GLSL/HDR-TV.shader @@ -0,0 +1,21 @@ + + + + + 0.5) intens = rgb * 0.8; + gl_FragColor = intens; + } + ]]> + diff --git a/pixelshaders/GLSL/HQ2x.shader b/pixelshaders/GLSL/HQ2x.shader new file mode 100755 index 00000000..d4f8c822 --- /dev/null +++ b/pixelshaders/GLSL/HQ2x.shader @@ -0,0 +1,73 @@ + + + + + + diff --git a/pixelshaders/GLSL/Pixellate.shader b/pixelshaders/GLSL/Pixellate.shader new file mode 100755 index 00000000..dc484899 --- /dev/null +++ b/pixelshaders/GLSL/Pixellate.shader @@ -0,0 +1,44 @@ + + + + + + diff --git a/pixelshaders/GLSL/Scale2x.shader b/pixelshaders/GLSL/Scale2x.shader new file mode 100755 index 00000000..b82cfb4d --- /dev/null +++ b/pixelshaders/GLSL/Scale2x.shader @@ -0,0 +1,55 @@ + + + + + = 0.5) { tmp = colB; colB = colH; colH = tmp; } //E1 (or E3): swap B and H + if(sel.x >= 0.5) { tmp = colF; colF = colD; colD = tmp; } //E2 (or E3): swap D and F + + if(colB == colD && colB != colF && colD != colH) { //do the Scale2x rule + col = colD; + } + + gl_FragColor = col; + } + ]]> + diff --git a/pixelshaders/HLSL/Sepia.shader b/pixelshaders/HLSL/Sepia.shader new file mode 100755 index 00000000..1fa725e2 --- /dev/null +++ b/pixelshaders/HLSL/Sepia.shader @@ -0,0 +1,30 @@ + + + ; }; + float3 LightColor = { 1.0, 0.7, 0.5 }; + float3 DarkColor = { 0.2, 0.05, 0.0 }; + + float4 DiffColorPass(in float2 Tex : TEXCOORD0) : COLOR0 + { + vec.x = 0.5; + vec.y = 1.0; + float3 scnColor = LightColor * tex2D(s0, Tex).xyz; + float3 grayXfer = float3(0.3, 0.59, 0.11); + float gray = dot(grayXfer, scnColor); + float3 muted = lerp(scnColor, gray.xxx, vec.x); + float3 sepia = lerp(DarkColor, LightColor, gray); + float3 result = lerp(muted, sepia, vec.y); + return float4(result, 1); + } + + Technique T0 + { + pass p0 { PixelShader = compile ps_2_0 DiffColorPass(); } + } + ]]> +