-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathbasic.vert
More file actions
32 lines (27 loc) · 729 Bytes
/
basic.vert
File metadata and controls
32 lines (27 loc) · 729 Bytes
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
#version 460
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable
layout (push_constant) uniform PushConsts
{
mat4 mvp;
vec3 fog_color;
float fog_density;
}
push_constants;
layout (location = 0) in vec3 in_position;
layout (location = 1) in vec2 in_texcoord;
layout (location = 2) in vec4 in_color;
layout (location = 0) out vec4 out_texcoord;
layout (location = 1) out vec4 out_color;
layout (location = 2) out float out_fog_frag_coord;
out gl_PerVertex
{
vec4 gl_Position;
};
void main ()
{
gl_Position = push_constants.mvp * vec4 (in_position, 1.0f);
out_texcoord = vec4 (in_texcoord.xy, 0.0f, 0.0f);
out_color = in_color;
out_fog_frag_coord = gl_Position.w;
}