From b53d2e2184fe117d750adab28a48585d9c4893f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 01:59:36 +0000 Subject: [PATCH 1/2] Bump ppy.osu.Framework from 2023.327.0 to 2023.403.0 Bumps [ppy.osu.Framework](https://github.com/ppy/osu-framework) from 2023.327.0 to 2023.403.0. - [Release notes](https://github.com/ppy/osu-framework/releases) - [Commits](https://github.com/ppy/osu-framework/compare/2023.327.0...2023.403.0) --- updated-dependencies: - dependency-name: ppy.osu.Framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- osu.Framework.Font/osu.Framework.Font.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Framework.Font/osu.Framework.Font.csproj b/osu.Framework.Font/osu.Framework.Font.csproj index 77822b0..76bd7e6 100644 --- a/osu.Framework.Font/osu.Framework.Font.csproj +++ b/osu.Framework.Font/osu.Framework.Font.csproj @@ -28,7 +28,7 @@ en - + From de2bf76a5ee5d4f12d7b3ff4a7b5d24aa0102807 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Mon, 3 Apr 2023 11:04:35 +0800 Subject: [PATCH 2/2] Fix the sRGB issue. See: https://github.com/karaoke-dev/osu-framework-font/issues/337 --- osu.Framework.Font.Tests/Resources/Shaders/sh_CRT.fs | 2 +- osu.Framework.Font/Graphics/Shaders/OutlineShader.cs | 5 +++-- osu.Framework.Font/Graphics/Shaders/ShadowShader.cs | 3 ++- osu.Framework.Font/Resources/Shaders/sh_Outline.fs | 2 +- osu.Framework.Font/Resources/Shaders/sh_Pixel.fs | 2 +- osu.Framework.Font/Resources/Shaders/sh_Rainbow.fs | 2 +- .../Resources/Shaders/sh_RepeatMovingBackground.fs | 2 +- osu.Framework.Font/Resources/Shaders/sh_Shadow.fs | 2 +- 8 files changed, 11 insertions(+), 9 deletions(-) diff --git a/osu.Framework.Font.Tests/Resources/Shaders/sh_CRT.fs b/osu.Framework.Font.Tests/Resources/Shaders/sh_CRT.fs index 6100642..3497e66 100644 --- a/osu.Framework.Font.Tests/Resources/Shaders/sh_CRT.fs +++ b/osu.Framework.Font.Tests/Resources/Shaders/sh_CRT.fs @@ -58,7 +58,7 @@ void main(void) if (insideLens(lensUV)) { - vec4 lensCol = toSRGB(texture2D(m_Sampler, lensUV * resolution)); + vec4 lensCol = texture2D(m_Sampler, lensUV * resolution); lensCol = scanlines(lensCol, lensUV); float smoothEdge = smoothLensEdge(lensUV); col = vec4(lensCol.rgb * smoothEdge, clamp(lensCol.a + 1.0 - smoothEdge, 0.0, 1.0)); diff --git a/osu.Framework.Font/Graphics/Shaders/OutlineShader.cs b/osu.Framework.Font/Graphics/Shaders/OutlineShader.cs index ef854c9..6cf922a 100644 --- a/osu.Framework.Font/Graphics/Shaders/OutlineShader.cs +++ b/osu.Framework.Font/Graphics/Shaders/OutlineShader.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.InteropServices; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Rendering; using osu.Framework.Graphics.Shaders.Types; @@ -29,8 +30,8 @@ public override void ApplyValue(IRenderer renderer) outlineParametersBuffer.Data = new OutlineParameters { - Colour = new Vector4(Colour.R, Colour.G, Colour.B, Colour.A), - OutlineColour = new Vector4(OutlineColour.R, OutlineColour.G, OutlineColour.B, OutlineColour.A), + Colour = new Vector4(Colour.ToSRGB().R, Colour.ToSRGB().G, Colour.ToSRGB().B, Colour.ToSRGB().A), + OutlineColour = new Vector4(OutlineColour.ToSRGB().R, OutlineColour.ToSRGB().G, OutlineColour.ToSRGB().B, OutlineColour.ToSRGB().A), Radius = Radius, }; diff --git a/osu.Framework.Font/Graphics/Shaders/ShadowShader.cs b/osu.Framework.Font/Graphics/Shaders/ShadowShader.cs index a35b69e..73b46b1 100644 --- a/osu.Framework.Font/Graphics/Shaders/ShadowShader.cs +++ b/osu.Framework.Font/Graphics/Shaders/ShadowShader.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.InteropServices; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics.Extensions; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Rendering; @@ -28,7 +29,7 @@ public override void ApplyValue(IRenderer renderer) shadowParametersBuffer.Data = new ShadowParameters { - Colour = new Vector4(ShadowColour.R, ShadowColour.G, ShadowColour.B, ShadowColour.A), + Colour = new Vector4(ShadowColour.ToSRGB().R, ShadowColour.ToSRGB().G, ShadowColour.ToSRGB().B, ShadowColour.ToSRGB().A), Offset = renderer.ToShaderVector2(ShadowOffset), }; diff --git a/osu.Framework.Font/Resources/Shaders/sh_Outline.fs b/osu.Framework.Font/Resources/Shaders/sh_Outline.fs index 84c84c0..4cb24ce 100644 --- a/osu.Framework.Font/Resources/Shaders/sh_Outline.fs +++ b/osu.Framework.Font/Resources/Shaders/sh_Outline.fs @@ -68,7 +68,7 @@ lowp vec4 outline(float radius, mediump vec2 texCoord, mediump vec2 texSize, med void main(void) { - lowp vec4 texColour = toSRGB(texture(sampler2D(m_Texture, m_Sampler), v_TexCoord)); + lowp vec4 texColour = texture(sampler2D(m_Texture, m_Sampler), v_TexCoord); lowp vec4 originColour = vec4(mix(texColour.rgb, g_Colour.rgb, g_Colour.a), texColour.a); lowp vec4 outlineColour = outline(g_Radius * g_InflationPercentage, v_TexCoord, g_TexSize, g_OutlineColour); diff --git a/osu.Framework.Font/Resources/Shaders/sh_Pixel.fs b/osu.Framework.Font/Resources/Shaders/sh_Pixel.fs index ba52d29..d087558 100644 --- a/osu.Framework.Font/Resources/Shaders/sh_Pixel.fs +++ b/osu.Framework.Font/Resources/Shaders/sh_Pixel.fs @@ -21,5 +21,5 @@ void main(void) uv = uv * separaorParts; uv = floor(uv); uv = uv / separaorParts; - o_Colour = toSRGB(texture(sampler2D(m_Texture, m_Sampler), uv)); + o_Colour = texture(sampler2D(m_Texture, m_Sampler), uv); } \ No newline at end of file diff --git a/osu.Framework.Font/Resources/Shaders/sh_Rainbow.fs b/osu.Framework.Font/Resources/Shaders/sh_Rainbow.fs index 1744830..5805af6 100644 --- a/osu.Framework.Font/Resources/Shaders/sh_Rainbow.fs +++ b/osu.Framework.Font/Resources/Shaders/sh_Rainbow.fs @@ -22,7 +22,7 @@ layout(location = 0) out vec4 o_Colour; void main(void) { float pos = (v_TexCoord.y - g_Uv[0]) / (g_Uv[1] - g_Uv[0]); - vec4 texColor = toSRGB(texture(sampler2D(m_Texture, m_Sampler), v_TexCoord)); + vec4 texColor = texture(sampler2D(m_Texture, m_Sampler), v_TexCoord); vec4 col = vec4(g_Section * ((g_Time * g_Speed) + pos), g_Saturation, g_Brightness, 1); vec4 finalCol = mix(texColor, vec4(hsv2rgb(col).xyz, texColor.a), g_Mix); diff --git a/osu.Framework.Font/Resources/Shaders/sh_RepeatMovingBackground.fs b/osu.Framework.Font/Resources/Shaders/sh_RepeatMovingBackground.fs index c58e60b..fc7e8d3 100644 --- a/osu.Framework.Font/Resources/Shaders/sh_RepeatMovingBackground.fs +++ b/osu.Framework.Font/Resources/Shaders/sh_RepeatMovingBackground.fs @@ -39,5 +39,5 @@ void main(void) { // get point colour from sample. vec4 texColor = texture(sampler2D(m_Texture, m_Sampler), v_TexCoord); vec4 repeatSampleColor = v_Colour * vec4(texture(sampler2D(m_RepeatTexture, m_RepeatSampler), fixedTexCoord).xyz, texColor.a); - o_Colour = toSRGB(mix(texColor, repeatSampleColor, g_Mix)); + o_Colour = mix(texColor, repeatSampleColor, g_Mix); } diff --git a/osu.Framework.Font/Resources/Shaders/sh_Shadow.fs b/osu.Framework.Font/Resources/Shaders/sh_Shadow.fs index 0de35c9..1c6c21d 100644 --- a/osu.Framework.Font/Resources/Shaders/sh_Shadow.fs +++ b/osu.Framework.Font/Resources/Shaders/sh_Shadow.fs @@ -21,7 +21,7 @@ lowp vec4 shadow(texture2D tex, mediump vec2 texCoord, mediump vec2 texSize, med void main(void) { - lowp vec4 texture = toSRGB(texture(sampler2D(m_Texture, m_Sampler), v_TexCoord)); + lowp vec4 texture = texture(sampler2D(m_Texture, m_Sampler), v_TexCoord); lowp vec4 shadow = shadow(m_Texture, v_TexCoord, g_TexSize, g_Colour, g_Offset * g_InflationPercentage); o_Colour = mix(shadow, texture, texture.a); } \ No newline at end of file