-
Notifications
You must be signed in to change notification settings - Fork 0
/
vshader.glsl
executable file
·32 lines (27 loc) · 793 Bytes
/
vshader.glsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifdef GL_ES
// Set default precision to medium
precision mediump int;
precision mediump float;
#endif
uniform mat4 mvp_matrix;
attribute vec4 a_position;
attribute vec2 a_texcoord;
attribute vec3 color;
attribute float lines;
varying vec2 v_texcoord;
varying vec3 colr;
void main()
{
// Calculate vertex position in screen space
gl_Position = mvp_matrix * a_position;
// Pass texture coordinate to fragment shader
// Value will be automatically interpolated to fragments inside polygon faces
//v_texcoord = a_texcoord;
if (lines > 0.5) {
colr = color;
}
else {
vec3 cl = vec3(min(abs(a_position.x) * 100.0, 100.0)/100.0, min(abs(a_position.y) * 100.0, 100.0)/100.0, min(abs(a_position.z) * 100.0, 100.0)/100.0);
colr = cl;
}
}