a lot of people don't get convinced by my "Pseudo-antialiasing " effect and is true is not near the quality of the true effect so :)

true antialiasing using supersampling:
3 modes implemented:
2x = is a one and a half samples supersampled buffer with a linear texture fetch, this produce a similar result of a 2x MSAA
4x = four samples with a aligned texture fetch in the center of the 4 samples, this produce a little best effect that the first mode.
8x = is a four samples with a  rotated grid fetching producing a nicer (really nicer in some cases) antialiasing.
please test an let me know if you like this :)
i remember to everyone that supersampling is expensive so don't complain in speed drops :)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5006 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado
2010-02-03 22:19:00 +00:00
parent d89c5dddcd
commit 090d7ec534
6 changed files with 106 additions and 163 deletions

View File

@ -385,40 +385,6 @@ void drawShadedTexQuad(IDirect3DTexture9 *texture,
RestoreShaders();
}
void drawFSAATexQuad(IDirect3DTexture9 *texture,
IDirect3DTexture9 *Depthtexture,
const RECT *rSource,
int SourceWidth,
int SourceHeight,
IDirect3DPixelShader9 *PShader,
IDirect3DVertexShader9 *Vshader,
int Intensity,
float DepthRange)
{
float sw = 1.0f /(float) SourceWidth;
float sh = 1.0f /(float) SourceHeight;
float u1=((float)rSource->left + 0.5f) * sw;
float u2=((float)rSource->right + 0.5f) * sw;
float v1=((float)rSource->top + 0.5f) * sh;
float v2=((float)rSource->bottom + 0.5f) * sh;
float FinalIntensity = 4.0f / pow(10.0,Intensity);
struct Q2DVertex { float x,y,z,rhw;float u,v,w,h,dr1,dr2; } coords[4] = {
{-1.0f, 1.0f, 0.0f,1.0f,u1, v1, sw, sh,FinalIntensity,DepthRange},
{ 1.0f, 1.0f, 0.0f,1.0f,u2, v1, sw, sh,FinalIntensity,DepthRange},
{ 1.0f,-1.0f, 0.0f,1.0f,u2, v2, sw, sh,FinalIntensity,DepthRange},
{-1.0f,-1.0f, 0.0f,1.0f,u1, v2, sw, sh,FinalIntensity,DepthRange}
};
dev->SetVertexShader(Vshader);
dev->SetPixelShader(PShader);
D3D::SetTexture(0, texture);
D3D::SetTexture(1, Depthtexture);
dev->SetFVF(D3DFVF_XYZW | D3DFVF_TEX3);
dev->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, coords, sizeof(Q2DVertex));
RestoreShaders();
}
void drawClearQuad(u32 Color,float z,IDirect3DPixelShader9 *PShader,IDirect3DVertexShader9 *Vshader)
{
struct Q2DVertex { float x,y,z,rhw;u32 color;} coords[4] = {