Author Topic: [FF7PC]FF7 SYW V3 upscale: Battle, world map, fields and videos (Final relesase)  (Read 2515 times)

Rumbah

  • Fast newbie
  • *
  • Posts: 41
  • Karma: 2
    • View Profile
Well, I actually tested for the right color space back then when I did the video files but I don't remember much as it's been a while :D
The shader to look for is the yuv.frag in the shader folder.

Actually I found two of these in my old folder so you could try both (should do the same, perhaps performance differences):

Code: [Select]
#version 110

uniform sampler2D y_tex;
uniform sampler2D u_tex;
uniform sampler2D v_tex;

uniform bool full_range;

const mat3 mpeg_rgb_transform = mat3(
1.164,  1.164,  1.164,
0.0,   -0.392,  2.017,
1.596, -0.813,  0.0
);

const mat3 jpeg_rgb_transform = mat3(
1.0,  1.0,   1.0,
0.0, -0.343, 1.765,
1.4, -0.711, 0.0
);

void main()
{
float y = texture2D(y_tex, gl_TexCoord[0].st).x;
float u = texture2D(u_tex, gl_TexCoord[0].st).x - 0.5;
float v = texture2D(v_tex, gl_TexCoord[0].st).x - 0.5;
vec3 yuv_color = vec3(y, u, v);
vec4 rgba_color;

if(full_range) rgba_color = vec4(jpeg_rgb_transform * yuv_color, 1.0);
else rgba_color = vec4(mpeg_rgb_transform * yuv_color, 1.0);

gl_FragColor = rgba_color;
}
Code: [Select]
#version 110

uniform sampler2D y_tex;
uniform sampler2D u_tex;
uniform sampler2D v_tex;

uniform bool full_range;

const mat3 rgb_transform = mat3(
1.0,    1.0,   1.0,
0.0,   -0.344, 1.77,
1.403, -0.714, 0.0
);

void main()
{
float y = texture2D(y_tex, gl_TexCoord[0].st).x;
float u = texture2D(u_tex, gl_TexCoord[0].st).x - 0.5;
float v = texture2D(v_tex, gl_TexCoord[0].st).x - 0.5;

if(!full_range) y = (y - (1.0 / 255.0) * 16.0) * (255.0 / (255.0 - 16.0));

vec3 yuv_color = vec3(y, u, v);
vec4 rgba_color = vec4(rgb_transform * yuv_color, 1.0);
gl_FragColor = rgba_color;
}
If both do not work because either ffmpeg does get the info wrong or the videos are not correctly signaled then one could hardcode the correct one in the shader.
And it depends on Aali's driver version, I think earlier ones always assumed full range, then it changed to (buggy?) detection.


kekko1285

  • Fast newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Just a suggestion, it might worth adding some screenshots in the first thread where also battle and more open world pictures are showed.

BahamutSIN

  • Fast newbie
  • *
  • Posts: 48
  • Karma: 0
    • View Profile
Thanks Rumbah. That second one seems to work well.

satsuki

  • Crazy poster
  • *
  • Posts: 205
  • Karma: 35
    • View Profile
    • My softs (french only)
Just a suggestion, it might worth adding some screenshots in the first thread where also battle and more open world pictures are showed.
Feel free to add your own and i'll paste then in the first post ^^