Add GLSL cylinder files

This commit is contained in:
EIntemporel
2022-11-15 19:41:04 +01:00
parent 26427e3307
commit f51c58a4bc
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
#version 330 core
uniform vec4 color;
out vec4 out_color;
void main()
{
out_color = color;
}

View File

@@ -0,0 +1,15 @@
#version 330 core
in vec4 position;
uniform mat4 model_view_projection;
uniform vec3 origin;
uniform int height;
uniform float radius;
void main()
{
vec3 offset = vec3(position.x * radius, position.y, position.z * radius);
vec3 p = origin + offset;
gl_Position = model_view_projection * vec4(p,1.);
}