2 changed files with 32 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||||
|
#version 330 core |
||||
|
in vec4 color; |
||||
|
|
||||
|
in float dist; |
||||
|
uniform vec2 u_resolution; |
||||
|
uniform float u_dashSize; |
||||
|
uniform float u_gapSize; |
||||
|
|
||||
|
out vec4 FragColor; |
||||
|
void main() |
||||
|
{ |
||||
|
if (fract(dist / (u_dashSize + u_gapSize)) > u_dashSize/(u_dashSize + u_gapSize)) |
||||
|
discard; |
||||
|
|
||||
|
FragColor = color; |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
#version 330 core |
||||
|
layout (location = 0) in vec3 vertices; |
||||
|
layout (location = 1) in float distances; |
||||
|
uniform vec4 ourColor; |
||||
|
|
||||
|
out float dist; |
||||
|
out vec4 color; |
||||
|
|
||||
|
uniform mat4 MVP; |
||||
|
|
||||
|
void main() |
||||
|
{ |
||||
|
dist = distances; |
||||
|
gl_Position = MVP * vec4(vertices,1.0); |
||||
|
color = ourColor; |
||||
|
} |
Loading…
Reference in new issue