2020-05-22 11:21:43 +00:00
|
|
|
#version 120
|
|
|
|
|
2020-11-16 09:29:54 +00:00
|
|
|
uniform bool use_fixed_screen_size;
|
2020-05-22 11:21:43 +00:00
|
|
|
uniform float zoom;
|
2020-05-29 10:29:04 +00:00
|
|
|
uniform float point_size;
|
|
|
|
uniform float near_plane_height;
|
2020-05-22 11:21:43 +00:00
|
|
|
|
2020-11-16 09:29:54 +00:00
|
|
|
float fixed_screen_size()
|
|
|
|
{
|
|
|
|
return point_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
float fixed_world_size()
|
|
|
|
{
|
|
|
|
return (gl_Position.w == 1.0) ? zoom * near_plane_height * point_size : near_plane_height * point_size / gl_Position.w;
|
|
|
|
}
|
|
|
|
|
2020-05-22 11:21:43 +00:00
|
|
|
void main()
|
|
|
|
{
|
2020-05-29 10:29:04 +00:00
|
|
|
gl_Position = ftransform();
|
2020-11-16 09:29:54 +00:00
|
|
|
gl_PointSize = use_fixed_screen_size ? fixed_screen_size() : fixed_world_size();
|
2020-05-22 11:21:43 +00:00
|
|
|
}
|