mirror of https://github.com/PCSX2/pcsx2.git
GSdx:
- Remove the silly upscale hacks from an earlier commit - Replace them with a less silly version in CreateSource() :p - Remove a few of the outer pixels from the visible area, as they often contain glitches git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2241 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
0548bfb85b
commit
856bcef278
|
@ -226,6 +226,7 @@ bool GSRenderer::Merge(int field)
|
|||
GSVector4 scale = GSVector4(tex[i]->GetScale()).xyxy();
|
||||
|
||||
src[i] = GSVector4(r) * scale / GSVector4(tex[i]->GetSize()).xyxy();
|
||||
src[i] += GSVector4(0.001f,0.001f,-0.001f,-0.001f); // crop a few of the outermost pixels, which are often buggy
|
||||
|
||||
GSVector2 o(0, 0);
|
||||
|
||||
|
@ -738,8 +739,9 @@ bool GSRenderer::IsLinear()
|
|||
{
|
||||
return mmag;
|
||||
}
|
||||
|
||||
if(!TEX1.LCM && !PRIM->FST) // if FST => assume Q = 1.0f (should not, but Q is very often bogus, 0 or DEN)
|
||||
// if FST => assume Q = 1.0f (should not, but Q is very often bogus, 0 or DEN)
|
||||
// Fixme : Why should Q be bogus?
|
||||
if(!TEX1.LCM /*&& !PRIM->FST*/)
|
||||
{
|
||||
float K = (float)TEX1.K / 16;
|
||||
float f = (float)(1 << TEX1.L) / log(2.0f);
|
||||
|
|
|
@ -261,55 +261,14 @@ public:
|
|||
|
||||
int tw = (int)(1 << context->TEX0.TW);
|
||||
int th = (int)(1 << context->TEX0.TH);
|
||||
|
||||
int multiplier = upscale_Multiplier();
|
||||
|
||||
GSVector4 WH(tw, th, w, h);
|
||||
|
||||
//Try to avoid small, common glitches with upscaling. This only takes care of slight
|
||||
//variations however. The bigger ones, where upscaling intruduces pixels with no data
|
||||
//cannot be fixed generally here. (Wild Arms games do this with their text.)
|
||||
if ( multiplier == 2 ) {
|
||||
if (tw < 17) {}
|
||||
else if (tw < 33) {}
|
||||
else if (tw < 65) {}
|
||||
else if (tw < 129) {}
|
||||
else if (tw < 257) {}
|
||||
else if (tw < 513) {vs_cb.VertexScale.x *= 1.0f - ((float)1 * -0.00002f); }
|
||||
else if (tw < 1025) {}
|
||||
|
||||
if (th < 17) {}
|
||||
else if (th < 33) {}
|
||||
else if (th < 65) {}
|
||||
else if (th < 129) {}
|
||||
else if (th < 257) {}
|
||||
else if (th < 513) {vs_cb.VertexScale.y *= 1.0f - ((float)1 * -0.00001f); }
|
||||
else if (th < 1025) {}
|
||||
}
|
||||
|
||||
if(PRIM->FST)
|
||||
{
|
||||
vs_cb.TextureScale = GSVector4(1.0f / 16) / WH.xyxy();
|
||||
//Try to avoid small, common glitches with upscaling. This only takes care of slight
|
||||
//variations however. The bigger ones, where upscaling intruduces pixels with no data
|
||||
//cannot be fixed generally here. (Wild Arms games do this with their text.)
|
||||
if ( multiplier == 2 ) {
|
||||
if (tw < 17) {}
|
||||
else if (tw < 33) {}
|
||||
else if (tw < 65) {}
|
||||
else if (tw < 129) {vs_cb.TextureScale.x *= 1.0f - ((float)4 * 0.0001f); }
|
||||
else if (tw < 257) {vs_cb.TextureScale.x *= 1.0f - ((float)2 * 0.0001f);}
|
||||
else if (tw < 513) {vs_cb.TextureScale.x *= 1.0f - ((float)6 * 0.0001f); }
|
||||
else if (tw < 1025) {}
|
||||
|
||||
if (th < 17) {}
|
||||
else if (th < 33) {vs_cb.TextureScale.y *= 1.0f - ((float)2 * 0.0001f); } //ar tonelico bg
|
||||
else if (th < 65) {}
|
||||
else if (th < 129) {vs_cb.TextureScale.y *= 1.0f - ((float)2 * 0.0001f); }
|
||||
else if (th < 257) {vs_cb.TextureScale.y *= 1.0f - ((float)2 * 0.0001f); }
|
||||
else if (th < 513) {vs_cb.TextureScale.y *= 1.0f - ((float)4 * 0.0001f); }
|
||||
else if (th < 1025) {}
|
||||
}
|
||||
//Maybe better?
|
||||
//vs_cb.TextureScale = GSVector4(1.0f / 16) * GSVector4(tex->m_texture->GetScale()).xyxy() / WH.zwzw();
|
||||
ps_sel.fst = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -619,20 +619,26 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
|
||||
GSVector4 dr(0, 0, w, h);
|
||||
|
||||
float multiplier = (float) m_renderer->upscale_Multiplier()-1;
|
||||
//dr += a few pixels, to fight blur/brightness layers beeing more offset the more we upscale
|
||||
if(w > dstsize.x)
|
||||
{
|
||||
scale.x = (float)dstsize.x / tw;
|
||||
dr.z = (float)dstsize.x * scale.x / dst->m_texture->GetScale().x;
|
||||
w = dstsize.x;
|
||||
dr += GSVector4 (0.25f*multiplier, 0.0f, 0.25f*multiplier, 0.0f);
|
||||
}
|
||||
else dr += GSVector4 (0.500f*multiplier, 0.0f, 0.500f*multiplier, 0.0f);
|
||||
|
||||
if(h > dstsize.y)
|
||||
{
|
||||
scale.y = (float)dstsize.y / th;
|
||||
dr.w = (float)dstsize.y * scale.y / dst->m_texture->GetScale().y;
|
||||
h = dstsize.y;
|
||||
dr += GSVector4 (0.0f, 0.25f*multiplier, 0.0f, 0.25f*multiplier);
|
||||
}
|
||||
|
||||
else dr += GSVector4 (0.0f, 0.5f*multiplier, 0.0f, 0.5f*multiplier);
|
||||
|
||||
GSVector4 sr(0, 0, w, h);
|
||||
|
||||
GSTexture* st = src->m_texture ? src->m_texture : dst->m_texture;
|
||||
|
|
Loading…
Reference in New Issue