mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00

This means that surface shading will not necessarily work well for arbitrary transformations of the surface. But the existing solution was flimsy anyway, and caused annoying issues with singularity points.
27 lines
No EOL
488 B
GLSL
27 lines
No EOL
488 B
GLSL
#version 330
|
|
|
|
in vec3 point;
|
|
in vec3 d_normal_point;
|
|
in vec2 im_coords;
|
|
in float opacity;
|
|
|
|
out vec3 v_point;
|
|
out vec3 v_unit_normal;
|
|
out vec2 v_im_coords;
|
|
out float v_opacity;
|
|
|
|
uniform float is_sphere;
|
|
uniform vec3 center;
|
|
|
|
#INSERT emit_gl_Position.glsl
|
|
#INSERT get_unit_normal.glsl
|
|
|
|
const float EPSILON = 1e-10;
|
|
|
|
void main(){
|
|
v_point = point;
|
|
v_unit_normal = normalize(d_normal_point - point);;
|
|
v_im_coords = im_coords;
|
|
v_opacity = opacity;
|
|
emit_gl_Position(point);
|
|
} |