blob: 7d8d50664fee1726486309ea11d27d8f9f63f153 (
plain)
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
|
#version 330
in vec3 vertexPosition;
in vec2 vertexTexCoord;
in vec3 vertexNormal;
in vec4 vertexColor;
uniform mat4 mvp;
noperspective out vec2 fragTexCoord;
noperspective out vec3 fragColor;
void main()
{
vec2 res = vec2(160.0, 120.0);
fragTexCoord = vertexTexCoord;
fragColor = vertexColor.rgb;
vec4 pop = mvp*vec4(vertexPosition, 1.0);
gl_Position = pop;
gl_Position.xyz = pop.xyz / pop.w;
gl_Position.xy = floor(res * gl_Position.xy) / res;
gl_Position.xyz *= pop.w;
fragColor = mix(fragColor, vec3(0.0), clamp(smoothstep(20.0, 24.0, length(pop.xyz)), 0.0, 1.0));
}
|