3b1b-manim/manimlib/shaders/quadratic_bezier_stroke/vert.glsl
Grant Sanderson abbe131e8d Track full cross product and dot product of tangent vectors at joints
And alter the convention of what flat_stroke means to be more sensible in 3d
2023-01-17 11:36:47 -08:00

27 lines
No EOL
540 B
GLSL

#version 330
uniform vec2 frame_shape;
in vec3 point;
in vec4 stroke_rgba;
in float stroke_width;
in vec3 joint_normal;
in vec4 joint_product;
// Bezier control point
out vec3 verts;
out vec4 v_joint_product;
out float v_stroke_width;
out vec4 v_color;
out float v_vert_index;
const float STROKE_WIDTH_CONVERSION = 0.01;
void main(){
verts = point;
v_stroke_width = STROKE_WIDTH_CONVERSION * stroke_width * frame_shape[1] / 8.0;
v_joint_product = joint_product;
v_color = stroke_rgba;
v_vert_index = gl_VertexID;
}