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

38 lines
807 B
Text
Raw Normal View History

2020-06-04 15:41:20 -07:00
#version 330
2023-01-13 21:42:34 -08:00
uniform vec4 clip_plane;
2020-06-04 15:41:20 -07:00
in vec3 point;
in vec3 du_point;
in vec3 dv_point;
2023-01-15 19:09:29 -08:00
in vec4 rgba;
2020-06-04 15:41:20 -07:00
out vec3 xyz_coords;
out vec3 v_normal;
2020-06-04 15:41:20 -07:00
out vec4 v_color;
#INSERT get_gl_Position.glsl
#INSERT get_rotated_surface_unit_normal_vector.glsl
#INSERT finalize_color.glsl
2020-06-04 15:41:20 -07:00
void main(){
xyz_coords = position_point_into_frame(point);
v_normal = get_rotated_surface_unit_normal_vector(point, du_point, dv_point);
2023-01-15 19:09:29 -08:00
v_color = rgba;
2020-06-04 15:41:20 -07:00
gl_Position = get_gl_Position(xyz_coords);
2023-01-13 21:42:34 -08:00
if(clip_plane.xyz != vec3(0.0, 0.0, 0.0)){
gl_ClipDistance[0] = dot(vec4(point, 1.0), clip_plane);
}
v_color = finalize_color(
2023-01-15 19:09:29 -08:00
rgba,
xyz_coords,
v_normal,
light_source_position,
camera_position,
reflectiveness,
gloss,
shadow
);
2020-06-04 15:41:20 -07:00
}