Skip to content

Commit 7b2dffa

Browse files
committed
Add points frag and vertex shaders
1 parent 85e9653 commit 7b2dffa

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/shaders/points.frag

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#version 150 core
2+
in vec3 color;
3+
out vec4 frag_color;
4+
5+
void main() {
6+
frag_color = vec4(color, 1.0f);
7+
}

src/shaders/points.vert

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#version 330 core
2+
layout (location = 0) in vec3 in_pos;
3+
layout (location = 1) in vec3 in_color;
4+
out vec3 color;
5+
6+
uniform mat4 model;
7+
uniform mat4 view;
8+
uniform mat4 projection;
9+
10+
void main() {
11+
gl_Position = projection * view * model * vec4(in_pos, 1.0);
12+
gl_PointSize = 1.0;
13+
color = in_color;
14+
}

0 commit comments

Comments
 (0)