mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-22 15:51:30 +11:00
Fix gbpass scaling misalignment
This commit is contained in:
parent
2a80829d45
commit
f9d9c9724c
|
@ -76,17 +76,14 @@ layout(location = 3) out vec2 one_texel;
|
||||||
//#define video_scale floor(registers.OutputSize.y * registers.SourceSize.w) <- moved to parameter
|
//#define video_scale floor(registers.OutputSize.y * registers.SourceSize.w) <- moved to parameter
|
||||||
|
|
||||||
// Size of the scaled video
|
// Size of the scaled video
|
||||||
//#define scaled_video_out (registers.SourceSize.xy * vec2(video_scale)) <- moved to parameter
|
//#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)
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec2 scaled_video_out = (registers.SourceSize.xy * vec2(registers.video_scale));
|
vec2 scaled_video_out = (registers.SourceSize.xy * vec2(registers.video_scale));
|
||||||
// Remaps position to integer scaled output
|
// Remaps position to integer scaled output
|
||||||
gl_Position = global.MVP * Position / vec4( vec2(registers.OutputSize.xy / scaled_video_out), 1.0, 1.0 );
|
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;
|
dot_size = registers.SourceSize.zw;
|
||||||
one_texel = 1.0 / (registers.SourceSize.xy * registers.video_scale);
|
one_texel = 1.0 / (registers.SourceSize.xy * registers.video_scale);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue