mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-02 00:48:43 +03:00
QIDISlicer1.0.0
This commit is contained in:
20
resources/shaders/ES/dashed_lines.fs
Normal file
20
resources/shaders/ES/dashed_lines.fs
Normal file
@@ -0,0 +1,20 @@
|
||||
#version 100
|
||||
|
||||
precision highp float;
|
||||
|
||||
// see as reference: https://stackoverflow.com/questions/52928678/dashed-line-in-opengl3
|
||||
|
||||
uniform float dash_size;
|
||||
uniform float gap_size;
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
varying float coord_s;
|
||||
|
||||
void main()
|
||||
{
|
||||
float inv_stride = 1.0 / (dash_size + gap_size);
|
||||
if (gap_size > 0.0 && fract(coord_s * inv_stride) > dash_size * inv_stride)
|
||||
discard;
|
||||
|
||||
gl_FragColor = uniform_color;
|
||||
}
|
||||
Reference in New Issue
Block a user