mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
26 lines
No EOL
531 B
GLSL
26 lines
No EOL
531 B
GLSL
#version 330
|
|
|
|
uniform float pixel_size;
|
|
uniform float anti_alias_width;
|
|
|
|
in vec3 point;
|
|
in float radius;
|
|
in vec4 rgba;
|
|
|
|
out vec4 color;
|
|
out float scaled_aaw;
|
|
out vec3 v_point;
|
|
out vec3 light_pos;
|
|
|
|
#INSERT emit_gl_Position.glsl
|
|
|
|
void main(){
|
|
v_point = point;
|
|
color = rgba;
|
|
scaled_aaw = (anti_alias_width * pixel_size) / radius;
|
|
|
|
emit_gl_Position(point);
|
|
float z = -10 * gl_Position.z;
|
|
float scaled_radius = radius * 1.0 / (1.0 - z);
|
|
gl_PointSize = 2 * ((scaled_radius / pixel_size) + anti_alias_width);
|
|
} |