Aqua.fx
// Created by Peachykeen
int mgeflags = 16;
sampler s0 = sampler_state { minfilter = linear; magfilter = linear; mipfilter = linear; addressu=clamp; addressv = clamp; };
vector sinvar;
vector linvar;
float2 rcpres;
float ripplemult = 1.0f; // change this or set it via script to increase/decrease movement
float maskmult = 1.2f; // change this to change the effected are (2 is half the screen, 4 none, 0 all). Below 1 will pull the edges off
float4 ripple( float2 Tex : TEXCOORD ) : COLOR0
{
float4 Color;
// set up a simple box fade, prevents the edges from pulling away
float dev = max( abs(0.5 - Tex.x), abs(0.5 - Tex.y) ) * maskmult;
dev = smoothstep(0.15, 1, (1- dev));
// prep sinvar to not go under and linvar to not jump
float sinv = ( sinvar.x + 1 ) / 2;
float lin = 2 * ( 0.5 - abs( linvar.x - 0.5 ) );
float curve = sinvar.a * sinvar.a;
// generate ripples
// pick random y values
float ripplerow = sin ( Tex.y * 19 ) * curve + lin * clamp((sin(Tex.x)-0.5), 0.9, 1.1);
ripplerow = saturate(ripplerow);
// combine the fade and ripple rows
float ripplemask = ( ripplerow * dev );
// set up the shift amount
float2 shift;
shift.x = smoothstep(-10, 10, sinvar.x) - 0.5;
shift.x = shift.x / 8;
// multiply in the mask
shift.x *= ripplemask * ripplemult;
// prep the vertical movement
shift.y = ( ( shift.x * sin((Tex.x*20)) ) ) * ripplemult;
// shift the x coord
Tex.x += ( shift.x );
// shift the y by just a little
Tex.y += ( shift.y );
// sample the texture from the new position
Color = tex2D( s0, Tex );
// and send that back...
return Color;
}
technique T0
{
pass p0
{
PixelShader = compile ps_2_0 ripple();
}
}
mublur.fx
//Author: Timeslip
//Blurs the screen
int mgeflags = 16;
texture thisframe;
texture lastpass;
PixelShader PS = asm
{
ps.1.4
def c0,0.0015625,0,0,1 //Used to mod r0,r2 (Use these value for a 640,480 resolution)
def c1,0,0.0020833,0,1 //Used to mod r1,r3
def c2,1.5,1.5,1.5,0.5 //Used to set the alpha channel
texcrd r0.rgb,t0 //Get texture coordinates
mov r0.a,c2 //And put a value in r0.a so the validater doesn't complain about uninitalized registers
sub r3,r0,c1 //Copy the texture coords into the first four registers and shift them slightly
sub r2,r0,c0
add r1,r0,c1
add r0,r0,c0
phase //Second phase
texld r0,r0 //Sample the backbuffer at the four different points
texld r1,r1
texld r2,r2
texld r3,r3
add r0,r0,r1 //Add 'em all up and divide by 4
add r0,r0,r2
add_d4 r0,r0,r3
};
Technique T0
{
Pass P0
{
PixelShader = asm
{
ps.1.0 //Start by copying the backbuffer without doing anything interesting to it
tex t0
mov r0,t0
};
}
Pass P1
{
Texture[0] =
Texture[1] =
Texture[2] =
Texture[3] =
PixelShader =
}
Pass P2 { PixelShader =
}