1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 04:05:35 +08:00

Merge pull request #21432 from EVAST9919/triangles-fix

Compute texel size in the DrawNode of TrianglesV2 component
This commit is contained in:
Bartłomiej Dach 2022-11-26 20:03:14 +01:00 committed by GitHub
commit 61bfd2f6b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,6 +229,7 @@ namespace osu.Game.Graphics.Backgrounds
private readonly List<TriangleParticle> parts = new List<TriangleParticle>();
private Vector2 size;
private float thickness;
private float texelSize;
private IVertexBatch<TexturedVertex2D>? vertexBatch;
@ -245,6 +246,7 @@ namespace osu.Game.Graphics.Backgrounds
texture = Source.texture;
size = Source.DrawSize;
thickness = Source.Thickness;
texelSize = Math.Max(1.5f / Source.ScreenSpaceDrawQuad.Size.X, 1.5f / Source.ScreenSpaceDrawQuad.Size.Y);
parts.Clear();
parts.AddRange(Source.parts);
@ -265,6 +267,7 @@ namespace osu.Game.Graphics.Backgrounds
shader.Bind();
shader.GetUniform<float>("thickness").UpdateValue(ref thickness);
shader.GetUniform<float>("texelSize").UpdateValue(ref texelSize);
foreach (TriangleParticle particle in parts)
{