mirror of
https://github.com/3b1b/manim.git
synced 2025-07-29 13:03:31 +08:00
38 lines
810 B
GLSL
38 lines
810 B
GLSL
#version 330
|
|
|
|
uniform vec4 clip_plane;
|
|
|
|
in vec3 point;
|
|
in vec3 du_point;
|
|
in vec3 dv_point;
|
|
in vec4 color;
|
|
|
|
out vec3 xyz_coords;
|
|
out vec3 v_normal;
|
|
out vec4 v_color;
|
|
|
|
#INSERT get_gl_Position.glsl
|
|
#INSERT get_rotated_surface_unit_normal_vector.glsl
|
|
#INSERT finalize_color.glsl
|
|
|
|
void main(){
|
|
xyz_coords = position_point_into_frame(point);
|
|
v_normal = get_rotated_surface_unit_normal_vector(point, du_point, dv_point);
|
|
v_color = color;
|
|
gl_Position = get_gl_Position(xyz_coords);
|
|
|
|
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(
|
|
color,
|
|
xyz_coords,
|
|
v_normal,
|
|
light_source_position,
|
|
camera_position,
|
|
reflectiveness,
|
|
gloss,
|
|
shadow
|
|
);
|
|
} |