3b1b-manim/manimlib/shaders/quadratic_bezier_stroke/vert.glsl

27 lines
540 B
Text
Raw Normal View History

2020-02-03 10:52:39 -08:00
#version 330
uniform vec2 frame_shape;
in vec3 point;
2023-01-15 19:09:29 -08:00
in vec4 stroke_rgba;
2020-02-03 10:52:39 -08:00
in float stroke_width;
in vec3 joint_normal;
in vec4 joint_product;
2020-02-03 10:52:39 -08:00
2020-06-01 16:21:18 -07:00
// Bezier control point
out vec3 verts;
2020-02-03 10:52:39 -08:00
out vec4 v_joint_product;
2020-02-03 10:52:39 -08:00
out float v_stroke_width;
out vec4 v_color;
2023-01-12 15:56:12 -08:00
out float v_vert_index;
2020-02-03 10:52:39 -08:00
2020-06-09 12:34:00 -07:00
const float STROKE_WIDTH_CONVERSION = 0.01;
2020-02-03 10:52:39 -08:00
void main(){
verts = point;
v_stroke_width = STROKE_WIDTH_CONVERSION * stroke_width * frame_shape[1] / 8.0;
v_joint_product = joint_product;
2023-01-15 19:09:29 -08:00
v_color = stroke_rgba;
2023-01-12 15:56:12 -08:00
v_vert_index = gl_VertexID;
2020-02-03 10:52:39 -08:00
}