Add dotted line shader.

master
smoogipooo 8 years ago
parent 29dda31250
commit 0e258afd11

@ -0,0 +1,40 @@
#ifdef GL_ES
precision mediump float;
#endif
#include "sh_Utils.h"
varying vec4 v_Colour;
uniform vec2 g_Position;
uniform vec2 g_Size;
uniform float g_Period;
uniform float g_PeriodOffset;
uniform float g_StrokeWidth;
uniform float g_StrokeHeight;
uniform float g_Separation;
void main(void)
{
float xVisible = mod(gl_FragCoord.x, g_StrokeWidth + g_Separation);
if (xVisible > g_StrokeWidth)
{
gl_FragColor = vec4(0.0);
return;
}
// Normalized
float normalizedY = gl_FragCoord.y - g_Position.y;
float yVisible = abs(normalizedY - ((g_Size.y / 2.0 - g_StrokeHeight / 2.0) * sin(g_Period / g_Size.x * gl_FragCoord.x + g_PeriodOffset) + g_Size.y / 2.0));
if (yVisible > g_StrokeHeight / 2.0)
{
gl_FragColor = vec4(0.0);
return;
}
gl_FragColor = toSRGB(v_Colour);
}

@ -588,6 +588,9 @@
<EmbeddedResource Include="Textures\Flags\ZW.png" /> <EmbeddedResource Include="Textures\Flags\ZW.png" />
<EmbeddedResource Include="Textures\Flags\__.png" /> <EmbeddedResource Include="Textures\Flags\__.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Shaders\sh_DottedLine.fs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

Loading…
Cancel
Save