opengl - Got points with white borders when drowning circle via gldrawarrays and GL_POINTS -


i'm trying draw circle opengl using gldrawarrays , gl_points. circle drawn correct, each point has got white border (see screenshot).

screenshot

here code:

glenable(gl_blend); glblendfunc(gl_src_alpha,gl_one_minus_src_alpha); glenable(gl_point_smooth); glhint(gl_point_smooth_hint, gl_nicest);  color* color = (color*)colors;  glenableclientstate(gl_vertex_array); pointsize *= this->getscale();  glpointsize(pointsize); glcolor4f(color->r/255.0f, color->g/255.0f, color->b/255.0f, 1.0f);  glvertexpointer(2, gl_float, 0, verts); gldrawarrays(gl_points, 0, count); gldisableclientstate(gl_vertex_array); 

i think, something's wrong blending mode, can't find right one. suggestions?

i believe gl_point_smooth intended used saturation blending glblendfunc(gl_src_alpha_saturate, gl_one) alpha calculated portion of pixel sprite overlaps. depth buffer may interfere rendering too.

for more accurate circle i'd suggest using triangle strip, or single textured or (if using shaders, implicitly coloured in fragment shader) quad.


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

java - What is the difference between String. and String.this. ? -