Add vignette to bloom shader, for that NEXT GEN FEELING!!! :D (eh)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3382 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-06-08 20:29:20 +00:00
parent 63ae48d9f9
commit e9a08dc281
2 changed files with 11 additions and 18 deletions

View File

@ -1,19 +1,8 @@
uniform samplerRECT samp0 : register(s0);
const float2 samples[8] = {
float2(-1.5, -1.5),
float2(-2.5, 0),
float2(-1.5, 1.5),
float2(0, 2.5),
float2(1.5, 1.5),
float2(2.5, 0),
float2(1.5, -1.5),
float2(0, -2.5),
};
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0, in float2 uv1 : TEXCOORD1)
{
float4 c_center = texRECT(samp0, uv0).rgba;
float4 c_center = texRECT(samp0, uv0.xy).rgba;
float4 bloom_sum = float4(0.0, 0.0, 0.0, 0.0);
uv0 += float2(0.3, 0.3);
@ -41,5 +30,9 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
bloom_sum -= float4(0.3, 0.3, 0.3, 0.3);
bloom_sum = max(bloom_sum, float4(0,0,0,0));
ocol0 = c_center * 0.7 + bloom_sum;
float2 vpos = (uv1 - float2(.5, .5)) * 2;
float dist = (dot(vpos, vpos));
dist = 1 - 0.4*dist;
ocol0 = (c_center * 0.7 + bloom_sum) * dist;
}

View File

@ -961,10 +961,10 @@ void Renderer::Swap(const TRectangle& rc)
PostProcessing::ApplyShader();
glBegin(GL_QUADS);
glTexCoord2f(0, v_min); glVertex2f(-1, -1);
glTexCoord2f(0, v_max); glVertex2f(-1, 1);
glTexCoord2f(u_max, v_max); glVertex2f( 1, 1);
glTexCoord2f(u_max, v_min); glVertex2f( 1, -1);
glTexCoord2f(0, v_min); glMultiTexCoord2fARB(GL_TEXTURE1, 0, 0); glVertex2f(-1, -1);
glTexCoord2f(0, v_max); glMultiTexCoord2fARB(GL_TEXTURE1, 0, 1); glVertex2f(-1, 1);
glTexCoord2f(u_max, v_max); glMultiTexCoord2fARB(GL_TEXTURE1, 1, 1); glVertex2f( 1, 1);
glTexCoord2f(u_max, v_min); glMultiTexCoord2fARB(GL_TEXTURE1, 1, 0); glVertex2f( 1, -1);
glEnd();
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);