Skip to content

Commit e6af079

Browse files
committed
Imroved appearance of points and perspective
1 parent 682b981 commit e6af079

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

res/shaders/points.vert

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ out float cursorDistance;
1717
void main() {
1818
vec4 world_position = modelMatrix * position;
1919
gl_Position = projMatrix * viewMatrix * world_position;
20+
21+
gl_PointSize = 1 + 3 / gl_Position.w;
22+
2023

2124
v_Color = color;
2225
vHighlight = highlight;

src/Renderer/OpenGL/VolumeRenderer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ void VolumeRenderer::drawCube(mv::ShaderProgram& shader)
476476
void VolumeRenderer::drawVolume(mv::ShaderProgram& shader, const bool& live)
477477
{
478478
if (_numPoints > 0) {
479+
glEnable(GL_POINT_SMOOTH);
480+
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
479481
glDisable(GL_BLEND);
480482
glEnable(GL_DEPTH_TEST);
481483
glDepthFunc(GL_LESS);
@@ -508,7 +510,8 @@ void VolumeRenderer::drawVolume(mv::ShaderProgram& shader, const bool& live)
508510

509511
glEnable(GL_BLEND);
510512
glDisable(GL_DEPTH_TEST);
511-
513+
glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
514+
glDisable(GL_POINT_SMOOTH);
512515
}
513516
}
514517

0 commit comments

Comments
 (0)