mirror of https://github.com/PCSX2/pcsx2.git
GSdx:
Add another scanline algorithm, made by pseudonym. This one is pretty fancy, using a cosinus function for generating the dark lines. It only works on unscaled output, so use software rendering or native resolution for hardware. It's an effect that works best on 240p converted games (like the SNES titles in Mega Man Collection). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5812 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
23ae6f0641
commit
1155dd6e21
|
@ -106,7 +106,7 @@ void GSDevice::Present(const GSVector4i& r, int shader)
|
|||
|
||||
if(m_current)
|
||||
{
|
||||
static int s_shader[4] = {0, 5, 6, 8}; // FIXME
|
||||
static int s_shader[5] = {0, 5, 6, 8, 9}; // FIXME
|
||||
|
||||
Present(m_current, m_backbuffer, GSVector4(r), s_shader[shader]);
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ public: // TODO
|
|||
{
|
||||
CComPtr<ID3D11InputLayout> il;
|
||||
CComPtr<ID3D11VertexShader> vs;
|
||||
CComPtr<ID3D11PixelShader> ps[9];
|
||||
CComPtr<ID3D11PixelShader> ps[10];
|
||||
CComPtr<ID3D11SamplerState> ln;
|
||||
CComPtr<ID3D11SamplerState> pt;
|
||||
CComPtr<ID3D11DepthStencilState> dss;
|
||||
|
|
|
@ -119,7 +119,7 @@ public: // TODO
|
|||
{
|
||||
CComPtr<IDirect3DVertexDeclaration9> il;
|
||||
CComPtr<IDirect3DVertexShader9> vs;
|
||||
CComPtr<IDirect3DPixelShader9> ps[9];
|
||||
CComPtr<IDirect3DPixelShader9> ps[10];
|
||||
Direct3DSamplerState9 ln;
|
||||
Direct3DSamplerState9 pt;
|
||||
Direct3DDepthStencilState9 dss;
|
||||
|
|
|
@ -534,7 +534,7 @@ void GSRenderer::EndCapture()
|
|||
void GSRenderer::KeyEvent(GSKeyEventData* e)
|
||||
{
|
||||
const unsigned int interlace_nb = 8;
|
||||
const unsigned int post_shader_nb = 4;
|
||||
const unsigned int post_shader_nb = 5;
|
||||
const unsigned int aspect_ratio_nb = 3;
|
||||
#ifdef _WINDOWS
|
||||
if(e->type == KEYPRESS)
|
||||
|
|
|
@ -204,6 +204,21 @@ PS_OUTPUT ps_main8(PS_INPUT input) // triangular
|
|||
return output;
|
||||
}
|
||||
|
||||
static const float PI = 3.14159265359f;
|
||||
PS_OUTPUT ps_main9(PS_INPUT input) // triangular
|
||||
{
|
||||
PS_OUTPUT output;
|
||||
|
||||
float2 texdim, halfpixel;
|
||||
Texture.GetDimensions(texdim.x, texdim.y);
|
||||
if (ddy(input.t.y) * texdim.y > 0.5)
|
||||
output.c = sample_c(input.t);
|
||||
else
|
||||
output.c = (0.5 - 0.5 * cos(2 * PI * input.t.y * texdim.y)) * sample_c(float2(input.t.x, (floor(input.t.y * texdim.y) + 0.5) / texdim.y));
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
#elif SHADER_MODEL <= 0x300
|
||||
|
||||
PS_OUTPUT ps_main1(PS_INPUT input)
|
||||
|
@ -284,5 +299,20 @@ PS_OUTPUT ps_main8(PS_INPUT input) // triangular
|
|||
return output;
|
||||
}
|
||||
|
||||
static const float PI = 3.14159265359f;
|
||||
PS_OUTPUT ps_main9(PS_INPUT input) // triangular
|
||||
{
|
||||
PS_OUTPUT output;
|
||||
|
||||
float2 texdim, halfpixel;
|
||||
Texture.GetDimensions(texdim.x, texdim.y);
|
||||
if (ddy(input.t.y) * texdim.y > 0.5)
|
||||
output.c = sample_c(input.t);
|
||||
else
|
||||
output.c = (0.5 - 0.5 * cos(2 * PI * input.t.y * texdim.y)) * sample_c(float2(input.t.x, (floor(input.t.y * texdim.y) + 0.5) / texdim.y));
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue