Improved image quality for the blur shaders when rotating screen 90 or 270 degrees.

This commit is contained in:
Leon Styhre 2023-02-21 18:43:18 +01:00
parent a6b95fdea4
commit 3869a51e9c
2 changed files with 16 additions and 10 deletions

View file

@ -46,13 +46,16 @@ out vec4 FragColor;
void main() void main()
{ {
vec4 SourceSize; vec4 SourceSize;
vec2 PIXEL_SIZE;
if (0x0u != (shaderFlags & 0x10u)) if (0x0u != (shaderFlags & 0x10u)) {
SourceSize = vec4(textureSize.yx, 1.0 / textureSize.yx); SourceSize = vec4(textureSize.yx, 1.0 / textureSize.xy);
else PIXEL_SIZE = vec2(SourceSize.w, SourceSize.z);
}
else {
SourceSize = vec4(textureSize.xy, 1.0 / textureSize.xy); SourceSize = vec4(textureSize.xy, 1.0 / textureSize.xy);
PIXEL_SIZE = vec2(SourceSize.z, SourceSize.w);
vec2 PIXEL_SIZE = vec2(SourceSize.z, SourceSize.w); }
float sampleOffsets[5] = float[5](0.0, 1.4347826, 3.3478260, 5.2608695, 7.1739130); float sampleOffsets[5] = float[5](0.0, 1.4347826, 3.3478260, 5.2608695, 7.1739130);
float sampleWeights[5] = float sampleWeights[5] =

View file

@ -46,13 +46,16 @@ out vec4 FragColor;
void main() void main()
{ {
vec4 SourceSize; vec4 SourceSize;
vec2 PIXEL_SIZE;
if (0x0u != (shaderFlags & 0x10u)) if (0x0u != (shaderFlags & 0x10u)) {
SourceSize = vec4(textureSize.yx, 1.0 / textureSize.yx); SourceSize = vec4(textureSize.xy, 1.0 / textureSize.yx);
else PIXEL_SIZE = vec2(SourceSize.w, SourceSize.z);
}
else {
SourceSize = vec4(textureSize.xy, 1.0 / textureSize.xy); SourceSize = vec4(textureSize.xy, 1.0 / textureSize.xy);
PIXEL_SIZE = vec2(SourceSize.z, SourceSize.w);
vec2 PIXEL_SIZE = vec2(SourceSize.z, SourceSize.w); }
float sampleOffsets[5] = float[5](0.0, 1.4347826, 3.3478260, 5.2608695, 7.1739130); float sampleOffsets[5] = float[5](0.0, 1.4347826, 3.3478260, 5.2608695, 7.1739130);
float sampleWeights[5] = float sampleWeights[5] =