mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Merge pull request #24613 from smoogipoo/masking-ssbo
Update framework and apply changes to support masking SSBO
This commit is contained in:
commit
b581d67416
@ -286,7 +286,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
if (time - part.Time >= 1)
|
if (time - part.Time >= 1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
vertexBatch.Add(new TexturedTrailVertex
|
vertexBatch.Add(new TexturedTrailVertex(renderer)
|
||||||
{
|
{
|
||||||
Position = new Vector2(part.Position.X - size.X * originPosition.X, part.Position.Y + size.Y * (1 - originPosition.Y)),
|
Position = new Vector2(part.Position.X - size.X * originPosition.X, part.Position.Y + size.Y * (1 - originPosition.Y)),
|
||||||
TexturePosition = textureRect.BottomLeft,
|
TexturePosition = textureRect.BottomLeft,
|
||||||
@ -295,7 +295,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
Time = part.Time
|
Time = part.Time
|
||||||
});
|
});
|
||||||
|
|
||||||
vertexBatch.Add(new TexturedTrailVertex
|
vertexBatch.Add(new TexturedTrailVertex(renderer)
|
||||||
{
|
{
|
||||||
Position = new Vector2(part.Position.X + size.X * (1 - originPosition.X), part.Position.Y + size.Y * (1 - originPosition.Y)),
|
Position = new Vector2(part.Position.X + size.X * (1 - originPosition.X), part.Position.Y + size.Y * (1 - originPosition.Y)),
|
||||||
TexturePosition = textureRect.BottomRight,
|
TexturePosition = textureRect.BottomRight,
|
||||||
@ -304,7 +304,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
Time = part.Time
|
Time = part.Time
|
||||||
});
|
});
|
||||||
|
|
||||||
vertexBatch.Add(new TexturedTrailVertex
|
vertexBatch.Add(new TexturedTrailVertex(renderer)
|
||||||
{
|
{
|
||||||
Position = new Vector2(part.Position.X + size.X * (1 - originPosition.X), part.Position.Y - size.Y * originPosition.Y),
|
Position = new Vector2(part.Position.X + size.X * (1 - originPosition.X), part.Position.Y - size.Y * originPosition.Y),
|
||||||
TexturePosition = textureRect.TopRight,
|
TexturePosition = textureRect.TopRight,
|
||||||
@ -313,7 +313,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
Time = part.Time
|
Time = part.Time
|
||||||
});
|
});
|
||||||
|
|
||||||
vertexBatch.Add(new TexturedTrailVertex
|
vertexBatch.Add(new TexturedTrailVertex(renderer)
|
||||||
{
|
{
|
||||||
Position = new Vector2(part.Position.X - size.X * originPosition.X, part.Position.Y - size.Y * originPosition.Y),
|
Position = new Vector2(part.Position.X - size.X * originPosition.X, part.Position.Y - size.Y * originPosition.Y),
|
||||||
TexturePosition = textureRect.TopLeft,
|
TexturePosition = textureRect.TopLeft,
|
||||||
@ -362,12 +362,22 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
[VertexMember(1, VertexAttribPointerType.Float)]
|
[VertexMember(1, VertexAttribPointerType.Float)]
|
||||||
public float Time;
|
public float Time;
|
||||||
|
|
||||||
|
[VertexMember(1, VertexAttribPointerType.Int)]
|
||||||
|
private readonly int maskingIndex;
|
||||||
|
|
||||||
|
public TexturedTrailVertex(IRenderer renderer)
|
||||||
|
{
|
||||||
|
this = default;
|
||||||
|
maskingIndex = renderer.CurrentMaskingIndex;
|
||||||
|
}
|
||||||
|
|
||||||
public bool Equals(TexturedTrailVertex other)
|
public bool Equals(TexturedTrailVertex other)
|
||||||
{
|
{
|
||||||
return Position.Equals(other.Position)
|
return Position.Equals(other.Position)
|
||||||
&& TexturePosition.Equals(other.TexturePosition)
|
&& TexturePosition.Equals(other.TexturePosition)
|
||||||
&& Colour.Equals(other.Colour)
|
&& Colour.Equals(other.Colour)
|
||||||
&& Time.Equals(other.Time);
|
&& Time.Equals(other.Time)
|
||||||
|
&& maskingIndex == other.maskingIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ layout(location = 4) out mediump vec2 v_BlendRange;
|
|||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
// Transform from screen space to masking space.
|
// Transform from screen space to masking space.
|
||||||
highp vec3 maskingPos = g_ToMaskingSpace * vec3(m_Position, 1.0);
|
highp vec3 maskingPos = g_MaskingInfo.ToMaskingSpace * vec3(m_Position, 1.0);
|
||||||
v_MaskingPosition = maskingPos.xy / maskingPos.z;
|
v_MaskingPosition = maskingPos.xy / maskingPos.z;
|
||||||
|
|
||||||
v_Colour = m_Colour;
|
v_Colour = m_Colour;
|
||||||
|
@ -126,12 +126,9 @@ namespace osu.Game.Screens
|
|||||||
private void load(ShaderManager manager)
|
private void load(ShaderManager manager)
|
||||||
{
|
{
|
||||||
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE));
|
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE));
|
||||||
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.BLUR));
|
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_2_NO_MASKING, FragmentShaderDescriptor.BLUR));
|
||||||
|
|
||||||
loadTargets.Add(manager.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE));
|
loadTargets.Add(manager.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE));
|
||||||
|
|
||||||
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_2, "TriangleBorder"));
|
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_2, "TriangleBorder"));
|
||||||
|
|
||||||
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_3, FragmentShaderDescriptor.TEXTURE));
|
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_3, FragmentShaderDescriptor.TEXTURE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Realm" Version="11.1.2" />
|
<PackageReference Include="Realm" Version="11.1.2" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2023.817.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2023.822.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2023.719.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2023.822.0" />
|
||||||
<PackageReference Include="Sentry" Version="3.28.1" />
|
<PackageReference Include="Sentry" Version="3.28.1" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
||||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||||
|
Loading…
Reference in New Issue
Block a user