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:
commit
61bfd2f6b2
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user