Simplify true_dot shaders

This commit is contained in:
Grant Sanderson
2023-01-18 15:36:00 -08:00
parent cd3c5031fa
commit 8e2cf04b71
5 changed files with 34 additions and 74 deletions

View File

@ -1,15 +1,26 @@
#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 float v_radius;
out vec4 v_color;
out vec3 light_pos;
#INSERT get_gl_Position.glsl
void main(){
v_point = point;
v_radius = radius;
v_color = rgba;
color = rgba;
scaled_aaw = (anti_alias_width * pixel_size) / radius;
gl_Position = get_gl_Position(point);
float z = -10 * gl_Position.z;
float scaled_radius = radius * 1.0 / (1.0 - z);
gl_PointSize = (scaled_radius / pixel_size) + anti_alias_width;
}