Circular point renderable

This commit is contained in:
aniisaaden
2020-07-15 13:57:00 +02:00
parent b4ffd3677b
commit 452d929dbe
2 changed files with 4 additions and 1 deletions
@@ -162,7 +162,6 @@ namespace openspace {
glBlendEquation(GL_FUNC_ADD);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_PROGRAM_POINT_SIZE); // Enable gl_PointSize in vertex
glEnable(GL_POINT_SMOOTH);
glBindVertexArray(_vaoID);
glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(_varray.size()));
@@ -37,6 +37,10 @@ Fragment getFragment() {
frag.depth = vs_depthClipSpace;
frag.gPosition = vs_positionViewSpace;
vec2 temp = gl_PointCoord - vec2(0.5);
float f = dot(temp, temp);
if (f>0.25) discard;
// There is no normal here
frag.gNormal = vec4(0.0, 0.0, -1.0, 1.0);