No guarantee that I manage to fix any game. Issue is quite complex.
@dabore,
I said something wrong the PS2 shader try to do nearest sampling but strangely the GPU is programmed to do linear sampling. Maybe it is the purpose of the filter option, I dunno what must be the real default value.
Quote: bool bilinear = m_filter == 2 ? m_vt.IsLinear() : m_filter != 0;
bool simple_sample = !tex->m_palette && cpsm.fmt == 0 && context->CLAMP.WMS < 3 && context->CLAMP.WMT < 3;
The emulated PS2 sampling
Quote: ps_sel.ltf = bilinear && !simple_sample;
The way the GPU will do the sampling (notice the missing !)
Quote: ps_ssel.ltf = bilinear && simple_sample;
Edit: situation is a bit better without bilinear filtering.
Mana khemia is still wrong because it would need to be clamped at sub-texture level. Now I will give a look again at AT.
Some picture of AT:
I force the texture sampler to always output an opaque blue + the real texture color. You can see that right and top edge are blue. It means those egde are wongly sampled. The others edge could a too small rectangle or a previous wrong drawing!
[
attachment=54681]
With only alpha value it is easier to see the missing pixel:
[
attachment=54682]
We need to add a way to calcule the primitive lenght (in native mode) and clamp texture sampling.
For example Mana Khemia use
(X only) a rectangle with position [0;16[ and texture coordinate [0.5;15.5]
In native texture will be sampled at 0.5+n*1 => [0;15] (n range from 0 to 15)
In 2x texture will be sampled at 0.5+n*0.5 => [0; 16] (r range from 0 to 31) but texel 16 doesn't exists.
I try to add a very small offset but it breaks others games, so it isn't a good idea.
Significant improvement.
Also the way it looks now is how Persona 3 looks normally - a single line at the top of the facial texture.
Do you still need a P3 GS dump btw?
Nope:
With a couple of correction on the Y axis:
[
attachment=54691]
However AT2 is still broken. It is even worst around the text outline. I'm not sure HACK will be viable.
[
attachment=54692]
Even AT2 looks better I think.
FWIW I noticed in AT2 - the "lines" are actually transparent areas. As in, you can see the background through them. I don't know if you noticed this or not.
Given that I've done some extraction work on AT2 sprites I can tell you that generally the face sprites are stored on a transparent background(generally either RGB 255,0,255 or RGB 0,255,0). It appears what's happening there is part of that transparency is being included in the actual texture by PCSX2, where it should just be ignored. I'm not sure if it's a result of bad precision on upscaling or something else, but thought it was worth a mentioned.
Actually, here is an actual sprite I have ripped directly from the game. This is from AT2(even though it's Aurica from AT1, the sprite was ripped from AT2 where she has a cameo appearance).
With this you can see exactly how the anime character is assembled:
New effect are harder to see, so at a quick glance it may seem better.
Oh don't worry I can see all rendering part one by one with textures. As far as I understand the major upscaling issue is that a rectangle of x/y pixels doesn't translate as a 2x/2y pixels in 2x upscaling. My hack mostly extends a bit the rectangle so the equation is more often true.
I can see the new issues in AT2 around the text box, and a few other minor ones.
The reason I said it was better is because to me a face is more important than a text box.