Skip to content

Commit

Permalink
Implement setting to change satellite size.
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-graj committed Apr 24, 2023
1 parent e6436ac commit 1cba834
Show file tree
Hide file tree
Showing 6 changed files with 1,665 additions and 1,589 deletions.
7 changes: 4 additions & 3 deletions res/shader/satellite.vert
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ layout (location = 0) in vec3 in_pos;
layout (location = 1) in vec3 in_color;

layout (location = 0) uniform mat4 transform;
layout (location = 1) uniform float scl;

out vec3 color;

const float scaling_factor = 15.0;
const float max_size = 8.0;
const float scaling_factor = 15.0f;
const float max_size = 6.0f;

void main()
{
gl_Position = transform * vec4(in_pos, 1.0f);
gl_PointSize = clamp(round(scaling_factor - scaling_factor * (gl_Position.z / gl_Position.w)), 1, max_size);
gl_PointSize = clamp(round(scaling_factor * scl * (1.0f - (gl_Position.z / gl_Position.w))), scl, max_size * (scl + 1.0f));
color = in_color;
}
Loading

0 comments on commit 1cba834

Please sign in to comment.