3b1b-manim/manimlib/shaders/quadratic_bezier/stroke/vert.glsl

29 lines
629 B
Text
Raw Normal View History

2020-02-03 10:52:39 -08:00
#version 330
uniform float frame_scale;
uniform float is_fixed_in_frame;
uniform float scale_stroke_with_zoom;
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 float joint_angle;
in vec3 unit_normal;
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_color;
out float v_stroke_width;
out float v_joint_angle;
out vec3 v_unit_normal;
2020-02-03 10:52:39 -08:00
const float STROKE_WIDTH_CONVERSION = 0.01;
2020-02-03 10:52:39 -08:00
void main(){
verts = point;
v_color = stroke_rgba;
v_stroke_width = STROKE_WIDTH_CONVERSION * stroke_width * mix(frame_scale, 1, scale_stroke_with_zoom);
v_joint_angle = joint_angle;
v_unit_normal = unit_normal;
2020-02-03 10:52:39 -08:00
}