mirror of
https://github.com/osukey/osukey.git
synced 2025-06-10 05:48:05 +09: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 readonly List<TriangleParticle> parts = new List<TriangleParticle>();
|
||||||
private Vector2 size;
|
private Vector2 size;
|
||||||
private float thickness;
|
private float thickness;
|
||||||
|
private float texelSize;
|
||||||
|
|
||||||
private IVertexBatch<TexturedVertex2D>? vertexBatch;
|
private IVertexBatch<TexturedVertex2D>? vertexBatch;
|
||||||
|
|
||||||
@ -245,6 +246,7 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
texture = Source.texture;
|
texture = Source.texture;
|
||||||
size = Source.DrawSize;
|
size = Source.DrawSize;
|
||||||
thickness = Source.Thickness;
|
thickness = Source.Thickness;
|
||||||
|
texelSize = Math.Max(1.5f / Source.ScreenSpaceDrawQuad.Size.X, 1.5f / Source.ScreenSpaceDrawQuad.Size.Y);
|
||||||
|
|
||||||
parts.Clear();
|
parts.Clear();
|
||||||
parts.AddRange(Source.parts);
|
parts.AddRange(Source.parts);
|
||||||
@ -265,6 +267,7 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
|
|
||||||
shader.Bind();
|
shader.Bind();
|
||||||
shader.GetUniform<float>("thickness").UpdateValue(ref thickness);
|
shader.GetUniform<float>("thickness").UpdateValue(ref thickness);
|
||||||
|
shader.GetUniform<float>("texelSize").UpdateValue(ref texelSize);
|
||||||
|
|
||||||
foreach (TriangleParticle particle in parts)
|
foreach (TriangleParticle particle in parts)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user