Fix gbpass scaling misalignment

This commit is contained in:
nfp0 2022-05-04 01:16:25 +01:00
parent 2a80829d45
commit f9d9c9724c

View file

@ -76,17 +76,14 @@ layout(location = 3) out vec2 one_texel;
//#define video_scale floor(registers.OutputSize.y * registers.SourceSize.w) <- moved to parameter
// Size of the scaled video
//#define scaled_video_out (registers.SourceSize.xy * vec2(video_scale)) <- moved to parameter
//it's... half a pixel
#define half_pixel (vec2(0.5) * registers.OutputSize.zw)
//#define scaled_video_out (registers.SourceSize.xy * vec2(video_scale)) <- moved to parameter
void main()
{
vec2 scaled_video_out = (registers.SourceSize.xy * vec2(registers.video_scale));
// Remaps position to integer scaled output
gl_Position = global.MVP * Position / vec4( vec2(registers.OutputSize.xy / scaled_video_out), 1.0, 1.0 );
vTexCoord = TexCoord + half_pixel;
vTexCoord = TexCoord;
dot_size = registers.SourceSize.zw;
one_texel = 1.0 / (registers.SourceSize.xy * registers.video_scale);
}