Skip to content

Commit

Permalink
Merge pull request #229 from EVAST9919/triangles-fix
Browse files Browse the repository at this point in the history
Remove dFdx/dFdy usage in TriangleBorder shader
  • Loading branch information
peppy authored Nov 26, 2022
2 parents 7416892 + 1eca186 commit 5151418
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions osu.Game.Resources/Shaders/sh_TriangleBorder.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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)
{
Expand All @@ -33,8 +34,6 @@ void main(void)
highp vec2 resolution = v_TexRect.zw - v_TexRect.xy;
highp vec2 pixelPos = (v_TexCoord - v_TexRect.xy) / resolution;

highp float texelSize = max(abs(dFdx(pixelPos.x)), abs(dFdy(pixelPos.y))) * 1.5;

if (!insideTriangle(pixelPos))
{
gl_FragColor = vec4(0.0);
Expand Down

0 comments on commit 5151418

Please sign in to comment.