diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..ccf29c3cd1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "ps3/pkg/USRDIR/shaders"] + path = ps3/pkg/USRDIR/shaders + url = git@github.com:twinaphex/common-shaders.git diff --git a/Makefile.ps3 b/Makefile.ps3 index 053bdcd235..8d90c9968a 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -73,6 +73,7 @@ $(PPU_TARGET): $(OBJ) pkg: $(PPU_TARGET) cp ssnes.cfg ps3/pkg/USRDIR/ + cp ps3/override/border-only.cg ps3/pkg/USRDIR/shaders/Borders/Menu/ $(MAKE_FSELF_NPDRM) $(PPU_TARGET) ps3/pkg/USRDIR/EBOOT.BIN $(MAKE_PACKAGE_NPDRM) ps3/pkg/package.conf ps3/pkg diff --git a/ps3/pkg/USRDIR/shaders/Borders/Menu/border-only.cg b/ps3/override/border-only.cg similarity index 100% rename from ps3/pkg/USRDIR/shaders/Borders/Menu/border-only.cg rename to ps3/override/border-only.cg diff --git a/ps3/pkg/USRDIR/shaders b/ps3/pkg/USRDIR/shaders new file mode 160000 index 0000000000..8603f0e02d --- /dev/null +++ b/ps3/pkg/USRDIR/shaders @@ -0,0 +1 @@ +Subproject commit 8603f0e02d384433e79d0833d98ea284cba55c73 diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Aspect/border-aspect.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Aspect/border-aspect.cg deleted file mode 100644 index 6c94d5bfba..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Aspect/border-aspect.cg +++ /dev/null @@ -1,77 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 1920x1080 border. :) -// Puts game in middle. - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float in_aspect = 16.0 / 9.0; -const float out_aspect = 4.0 / 3.0; - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD0, - float2 oTex : TEXCOORD0, - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - out float2 border, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 middle = 0.5 * IN.video_size / IN.texture_size; - - float dist = tex.x - middle.x; - float x = middle.x + dist.x * in_aspect / out_aspect; - oTex = float2(x, tex.y); - - border = float2(0.5 - out_aspect / in_aspect, 0.5 + out_aspect / in_aspect); - - otex_border = tex_border; -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, - float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN, - in float2 border) : COLOR -{ - float4 background = tex2D(bg, tex_border); - float4 source_image = tex2D(s0, tex); - - float sel; - if (tex.x < border.x || tex.x > border.y) - { - sel = 0.0; - } - else - { - sel = 1.0; - } - - return lerp(background, source_image, sel); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-fbo-scale-1x.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-fbo-scale-1x.cg deleted file mode 100644 index 3c233aa60d..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-fbo-scale-1x.cg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 4.0; // 4x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.5 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - return float4(back.rgb, back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-fbo-scale-2x.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-fbo-scale-2x.cg deleted file mode 100644 index 787c900761..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-fbo-scale-2x.cg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 2.0; // 2x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.5 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - return float4(back.rgb, back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-fbo-scale-4x.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-fbo-scale-4x.cg deleted file mode 100644 index 438a6cdb27..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-fbo-scale-4x.cg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 1.0; // 1x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.5 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - return float4(back.rgb, back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-non-fbo.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-non-fbo.cg deleted file mode 100644 index 3c233aa60d..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-non-fbo.cg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 4.0; // 4x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.5 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - return float4(back.rgb, back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-fbo-scale-1x.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-fbo-scale-1x.cg deleted file mode 100644 index 85cb223790..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-fbo-scale-1x.cg +++ /dev/null @@ -1,92 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 4.0; // 4x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.5 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float apply_wave(float2 pos, float2 src, float cnt) -{ - float2 diff = pos - src; - float dist = 300.0 * sqrt(dot(diff, diff)); - dist -= 0.15 * cnt; - return sin(dist); -} - -const float2 src0 = float2(0.6, 0.7); -const float2 src1 = float2(0.9, 0.9); -const float2 src2 = float2(-0.6, 0.3); -const float2 src3 = float2(0.1, 0.4); -const float2 src4 = float2(0.1, 0.4); -const float2 src5 = float2(0.5, 0.5); -const float2 src6 = float2(-1.0, 1.0); - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - float cnt = frame_count; - float res = apply_wave(coord, src0, cnt); - res += apply_wave(coord, src1, cnt); - res += apply_wave(coord, src2, cnt); - res += apply_wave(coord, src3, cnt); - res += apply_wave(coord, src4, cnt); - res += apply_wave(coord, src5, cnt); - res += apply_wave(coord, src6, cnt); - - return float4(back.rgb * (0.7 + 0.05 * res), back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-fbo-scale-2x.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-fbo-scale-2x.cg deleted file mode 100644 index 03750aac64..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-fbo-scale-2x.cg +++ /dev/null @@ -1,92 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 2.0; // 2x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.5 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float apply_wave(float2 pos, float2 src, float cnt) -{ - float2 diff = pos - src; - float dist = 300.0 * sqrt(dot(diff, diff)); - dist -= 0.15 * cnt; - return sin(dist); -} - -const float2 src0 = float2(0.6, 0.7); -const float2 src1 = float2(0.9, 0.9); -const float2 src2 = float2(-0.6, 0.3); -const float2 src3 = float2(0.1, 0.4); -const float2 src4 = float2(0.1, 0.4); -const float2 src5 = float2(0.5, 0.5); -const float2 src6 = float2(-1.0, 1.0); - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - float cnt = frame_count; - float res = apply_wave(coord, src0, cnt); - res += apply_wave(coord, src1, cnt); - res += apply_wave(coord, src2, cnt); - res += apply_wave(coord, src3, cnt); - res += apply_wave(coord, src4, cnt); - res += apply_wave(coord, src5, cnt); - res += apply_wave(coord, src6, cnt); - - return float4(back.rgb * (0.7 + 0.05 * res), back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-fbo-scale-4x.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-fbo-scale-4x.cg deleted file mode 100644 index b24f618692..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-fbo-scale-4x.cg +++ /dev/null @@ -1,92 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 1.0; // 1x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.5 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float apply_wave(float2 pos, float2 src, float cnt) -{ - float2 diff = pos - src; - float dist = 300.0 * sqrt(dot(diff, diff)); - dist -= 0.15 * cnt; - return sin(dist); -} - -const float2 src0 = float2(0.6, 0.7); -const float2 src1 = float2(0.9, 0.9); -const float2 src2 = float2(-0.6, 0.3); -const float2 src3 = float2(0.1, 0.4); -const float2 src4 = float2(0.1, 0.4); -const float2 src5 = float2(0.5, 0.5); -const float2 src6 = float2(-1.0, 1.0); - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - float cnt = frame_count; - float res = apply_wave(coord, src0, cnt); - res += apply_wave(coord, src1, cnt); - res += apply_wave(coord, src2, cnt); - res += apply_wave(coord, src3, cnt); - res += apply_wave(coord, src4, cnt); - res += apply_wave(coord, src5, cnt); - res += apply_wave(coord, src6, cnt); - - return float4(back.rgb * (0.7 + 0.05 * res), back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-non-fbo.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-non-fbo.cg deleted file mode 100644 index 85cb223790..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Centered/border-centered-water-non-fbo.cg +++ /dev/null @@ -1,92 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 4.0; // 4x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.5 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float apply_wave(float2 pos, float2 src, float cnt) -{ - float2 diff = pos - src; - float dist = 300.0 * sqrt(dot(diff, diff)); - dist -= 0.15 * cnt; - return sin(dist); -} - -const float2 src0 = float2(0.6, 0.7); -const float2 src1 = float2(0.9, 0.9); -const float2 src2 = float2(-0.6, 0.3); -const float2 src3 = float2(0.1, 0.4); -const float2 src4 = float2(0.1, 0.4); -const float2 src5 = float2(0.5, 0.5); -const float2 src6 = float2(-1.0, 1.0); - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - float cnt = frame_count; - float res = apply_wave(coord, src0, cnt); - res += apply_wave(coord, src1, cnt); - res += apply_wave(coord, src2, cnt); - res += apply_wave(coord, src3, cnt); - res += apply_wave(coord, src4, cnt); - res += apply_wave(coord, src5, cnt); - res += apply_wave(coord, src6, cnt); - - return float4(back.rgb * (0.7 + 0.05 * res), back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-fbo-scale-1x.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-fbo-scale-1x.cg deleted file mode 100644 index 065f37937b..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-fbo-scale-1x.cg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 4.0; // 4x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.2 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - return float4(back.rgb, back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-fbo-scale-2x.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-fbo-scale-2x.cg deleted file mode 100644 index 72365a59ba..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-fbo-scale-2x.cg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 2.0; // 2x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.2 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - return float4(back.rgb, back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-fbo-scale-4x.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-fbo-scale-4x.cg deleted file mode 100644 index d9fa35da65..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-fbo-scale-4x.cg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 1.0; // 1x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.2 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - return float4(back.rgb, back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-non-fbo.cg b/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-non-fbo.cg deleted file mode 100644 index 065f37937b..0000000000 --- a/ps3/pkg/USRDIR/shaders/Borders/Border-Left-Portrait/border-left-portrait-non-fbo.cg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Author: Themaister - License: Public domain -*/ - -// Border shader. 4x input scale, 1920x1080 border. :) - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; - float frame_count; -}; - -const float box_scale = 4.0; // 4x scale. -const float2 out_res = float2(1920.0, 1080.0); // Output target size. - -void main_vertex -( - float4 position : POSITION, - out float4 oPosition : POSITION, - uniform float4x4 modelViewProj, - - float4 color : COLOR, - out float4 oColor : COLOR, - - float2 tex : TEXCOORD, - out float2 oTex : TEXCOORD, - - float2 tex_border : TEXCOORD1, - out float2 otex_border : TEXCOORD1, - - uniform input IN -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - - float2 corrected_size = float2(256.0, 224.0) * (4.0 / box_scale); - float2 scale = (IN.output_size / corrected_size) / box_scale; - float2 middle = 0.2 * IN.video_size / IN.texture_size; - float2 diff = tex.xy - middle; - oTex = middle + diff * scale; - - middle = float2(0.5, 0.5); - float2 dist = tex_border - middle; - otex_border = middle + dist * IN.output_size / out_res; -} - -float4 conv_background(float4 back, float2 coord, float frame_count) -{ - return float4(back.rgb, back.a); -} - -float4 main_fragment ( - float2 tex : TEXCOORD0, float2 tex_border : TEXCOORD1, - uniform sampler2D s0 : TEXUNIT0, - uniform sampler2D bg, - uniform input IN) : COLOR -{ - float4 frame = tex2D(s0, tex); - float4 background = conv_background(tex2D(bg, tex_border), tex_border, IN.frame_count); - return lerp(frame, background, background.a); -} - - diff --git a/ps3/pkg/USRDIR/shaders/stock.cg b/ps3/pkg/USRDIR/shaders/stock.cg deleted file mode 100644 index c438e9969f..0000000000 --- a/ps3/pkg/USRDIR/shaders/stock.cg +++ /dev/null @@ -1,45 +0,0 @@ -/* - VERTEX_SHADER -*/ -void main_vertex -( - float4 position : POSITION, - float4 color : COLOR, - float2 texCoord : TEXCOORD0, - - uniform float4x4 modelViewProj, - - out float4 oPosition : POSITION, - out float4 oColor : COLOR, - out float2 otexCoord : TEXCOORD -) -{ - oPosition = mul(modelViewProj, position); - oColor = color; - otexCoord = texCoord; -} - - -/* - FRAGMENT SHADER -*/ -struct output -{ - float4 color : COLOR; -}; - -struct input -{ - float2 video_size; - float2 texture_size; - float2 output_size; -}; - - -output main_fragment(float2 texCoord : TEXCOORD0, uniform sampler2D decal : TEXUNIT0, uniform input IN) -{ - output OUT; - OUT.color = tex2D(decal, texCoord); - return OUT; -} -