Skip to content

Commit e936683

Browse files
committed
emulate GL_POINT_SMOOTH in point shader
1 parent 1ea8012 commit e936683

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/opengl/legacy/impl_gl20.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,20 @@ bool Functions::tryEnableMultisampling(const int requestedSamples)
6060
if (hasMultisampling && requestedSamples > 0) {
6161
Base::glEnable(GL_MULTISAMPLE);
6262

63-
//Base::glEnable(GL_POINT_SMOOTH);
6463
Base::glEnable(GL_LINE_SMOOTH);
6564
Base::glDisable(GL_POLYGON_SMOOTH);
66-
//Base::glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
6765
Base::glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
6866

6967
return true;
7068
} else {
7169
// NOTE: Currently we can use OpenGL 2.1 to fake multisampling with point/line/polygon smoothing.
7270
// TODO: We can use OpenGL 3.x FBOs to do multisampling even if the default framebuffer doesn't support it.
7371
if (requestedSamples > 0) {
74-
//Base::glEnable(GL_POINT_SMOOTH);
7572
Base::glEnable(GL_LINE_SMOOTH);
7673
Base::glDisable(GL_POLYGON_SMOOTH);
77-
//Base::glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
7874
Base::glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
7975
return true;
8076
} else {
81-
//Base::glDisable(GL_POINT_SMOOTH);
8277
Base::glDisable(GL_LINE_SMOOTH);
8378
Base::glDisable(GL_POLYGON_SMOOTH);
8479
return false;

src/resources/shaders/legacy/point/frag.glsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ out vec4 vFragmentColor;
99

1010
void main()
1111
{
12+
if (dot(gl_PointCoord-0.5, gl_PointCoord-0.5) > 0.25) {
13+
discard;
14+
}
1215
vFragmentColor = vColor * uColor;
1316
}

0 commit comments

Comments
 (0)