Compare commits
11 Commits
2022.1103.
...
2022.1127.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5151418446 | ||
|
|
1eca186493 | ||
|
|
7416892e34 | ||
|
|
3653f7477d | ||
|
|
abc3834535 | ||
|
|
3dad98e20c | ||
|
|
d9409e12f0 | ||
|
|
979b1027e6 | ||
|
|
05a035cf77 | ||
|
|
5c66f56cfd | ||
|
|
b5a8857bc6 |
@@ -4,11 +4,11 @@ attribute vec2 m_TexCoord;
|
||||
attribute vec4 m_TexRect;
|
||||
attribute float m_Time;
|
||||
|
||||
varying vec2 v_DrawingPosition;
|
||||
varying vec2 v_MaskingPosition;
|
||||
varying vec4 v_Colour;
|
||||
varying vec2 v_TexCoord;
|
||||
varying vec4 v_TexRect;
|
||||
varying vec2 v_BlendRange;
|
||||
|
||||
uniform mat4 g_ProjMatrix;
|
||||
uniform mat3 g_ToMaskingSpace;
|
||||
@@ -23,14 +23,11 @@ void main(void)
|
||||
vec3 maskingPos = g_ToMaskingSpace * vec3(m_Position, 1.0);
|
||||
v_MaskingPosition = maskingPos.xy / maskingPos.z;
|
||||
|
||||
// Transform to position to masking space.
|
||||
vec3 drawingPos = g_ToDrawingSpace * vec3(m_Position, 1.0);
|
||||
v_DrawingPosition = drawingPos.xy / drawingPos.z;
|
||||
|
||||
v_Colour = vec4(m_Colour.rgb, m_Colour.a * pow(clamp(m_Time - g_FadeClock, 0.0, 1.0), g_FadeExponent));
|
||||
|
||||
v_TexCoord = m_TexCoord;
|
||||
v_TexRect = m_TexRect;
|
||||
v_BlendRange = vec2(0.0);
|
||||
|
||||
gl_Position = g_ProjMatrix * vec4(m_Position, 1.0, 1.0);
|
||||
}
|
||||
|
||||
53
osu.Game.Resources/Shaders/sh_TriangleBorder.fs
Normal file
53
osu.Game.Resources/Shaders/sh_TriangleBorder.fs
Normal file
@@ -0,0 +1,53 @@
|
||||
#define HIGH_PRECISION_VERTEX
|
||||
|
||||
#include "sh_Utils.h"
|
||||
#include "sh_Masking.h"
|
||||
|
||||
varying highp vec2 v_TexCoord;
|
||||
|
||||
uniform lowp sampler2D m_Sampler;
|
||||
uniform mediump float thickness;
|
||||
uniform highp float texelSize;
|
||||
|
||||
highp float dstToLine(highp vec2 start, highp vec2 end, highp vec2 pixelPos)
|
||||
{
|
||||
highp float lineLength = distance(end, start);
|
||||
|
||||
if (lineLength < 0.001)
|
||||
return distance(pixelPos, start);
|
||||
|
||||
highp vec2 a = (end - start) / lineLength;
|
||||
highp vec2 closest = clamp(dot(a, pixelPos - start), 0.0, distance(end, start)) * a + start; // closest point on a line from given position
|
||||
return distance(closest, pixelPos);
|
||||
}
|
||||
|
||||
bool insideTriangle(highp vec2 pixelPos)
|
||||
{
|
||||
bool inLeftPart = pixelPos.x < 0.5 && pixelPos.x > 0.5 * (1.0 - pixelPos.y);
|
||||
bool inRightPart = pixelPos.x > 0.5 && pixelPos.x < 0.5 * (1.0 + pixelPos.y);
|
||||
|
||||
return inLeftPart || inRightPart;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
highp vec2 resolution = v_TexRect.zw - v_TexRect.xy;
|
||||
highp vec2 pixelPos = (v_TexCoord - v_TexRect.xy) / resolution;
|
||||
|
||||
if (!insideTriangle(pixelPos))
|
||||
{
|
||||
gl_FragColor = vec4(0.0);
|
||||
return;
|
||||
}
|
||||
|
||||
highp float dst1 = dstToLine(vec2(0.0, 1.0), vec2(1.0), pixelPos);
|
||||
highp float dst2 = dstToLine(vec2(1.0), vec2(0.5, 0.0), pixelPos);
|
||||
highp float dst3 = dstToLine(vec2(0.0, 1.0), vec2(0.5, 0.0), pixelPos);
|
||||
highp float dst = min(min(dst1, dst2), dst3);
|
||||
|
||||
lowp float alpha = dst < texelSize ? dst / texelSize : smoothstep(texelSize, 0.0, dst - thickness);
|
||||
|
||||
lowp vec4 col = getRoundedColor(texture2D(m_Sampler, v_TexCoord), v_TexCoord);
|
||||
|
||||
gl_FragColor = vec4(col.rgb, col.a * alpha);
|
||||
}
|
||||
BIN
osu.Game.Resources/Textures/Icons/BeatmapDetails/streams.png
Normal file
BIN
osu.Game.Resources/Textures/Icons/BeatmapDetails/streams.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 860 B |
Reference in New Issue
Block a user