2020-06-04 15:41:20 -07:00
|
|
|
#version 330
|
|
|
|
|
2023-01-13 21:42:34 -08:00
|
|
|
uniform vec4 clip_plane;
|
2023-01-13 21:04:36 -08:00
|
|
|
|
2020-06-04 15:41:20 -07:00
|
|
|
in vec3 point;
|
2020-06-05 11:12:52 -07:00
|
|
|
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
|
|
|
|
2020-06-05 11:12:52 -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
|
2020-06-05 11:12:52 -07:00
|
|
|
#INSERT get_rotated_surface_unit_normal_vector.glsl
|
2023-01-13 21:04:36 -08:00
|
|
|
#INSERT finalize_color.glsl
|
2020-06-04 15:41:20 -07:00
|
|
|
|
|
|
|
void main(){
|
2020-06-05 11:12:52 -07:00
|
|
|
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:04:36 -08:00
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2023-01-13 21:04:36 -08:00
|
|
|
v_color = finalize_color(
|
2023-01-15 19:09:29 -08:00
|
|
|
rgba,
|
2023-01-13 21:04:36 -08:00
|
|
|
xyz_coords,
|
|
|
|
v_normal,
|
|
|
|
light_source_position,
|
|
|
|
camera_position,
|
|
|
|
reflectiveness,
|
|
|
|
gloss,
|
|
|
|
shadow
|
|
|
|
);
|
2020-06-04 15:41:20 -07:00
|
|
|
}
|