How exactly do I add motion blur to the GBA shaders? I managed to actually add it, but for some reason, no matter where I position it within the GBA border .cgp config (GBA-standard-4x.cgp, in this case), it cancels out the color correction. The motion blur .cg I’m using is as follows:
struct previous
{
uniform sampler2D texture;
float2 tex_coord;
};
struct input
{
float2 video_size;
float2 texture_size;
float2 output_size;
float frame_count;
float frame_direction;
float frame_rotation;
sampler2D texture : TEXUNIT0;
};
struct tex_coords
{
float2 tex;
float2 prev;
float2 prev1;
float2 prev2;
float2 prev3;
float2 prev4;
float2 prev5;
float2 prev6;
};
void main_vertex
(
float4 position : POSITION,
out float4 oPosition : POSITION,
uniform float4x4 modelViewProj,
float2 tex : TEXCOORD,
previous PREV,
previous PREV1,
previous PREV2,
previous PREV3,
previous PREV4,
previous PREV5,
previous PREV6,
out tex_coords coords
)
{
oPosition = mul(modelViewProj, position);
coords = tex_coords(tex, PREV.tex_coord,
PREV1.tex_coord,
PREV2.tex_coord,
PREV3.tex_coord,
PREV4.tex_coord,
PREV5.tex_coord,
PREV6.tex_coord);
}
struct output
{
float4 col : COLOR;
};
output main_fragment(tex_coords coords,
uniform input IN,
previous PREV,
previous PREV1,
previous PREV2,
previous PREV3,
previous PREV4,
previous PREV5,
previous PREV6
)
{
float4 color = tex2D(PREV6.texture, coords.prev6);
color = (color + tex2D(PREV5.texture, coords.prev5)) / 2.0;
color = (color + tex2D(PREV4.texture, coords.prev4)) / 2.0;
color = (color + tex2D(PREV3.texture, coords.prev3)) / 2.0;
color = (color + tex2D(PREV2.texture, coords.prev2)) / 2.0;
color = (color + tex2D(PREV1.texture, coords.prev1)) / 2.0;
color = (color + tex2D(PREV.texture, coords.prev)) / 2.0;
color = (color + tex2D(IN.texture, coords.tex)) / 2.0;
output OUT;
OUT.col = color;
return OUT;
}
By the way, any chance of a white GBA version for the overlay?