Lines adjacent to a triangle render with poor quality

Feb 18, 2016 at 2:35 PM
Hi everyone!
I have a question here. I am using lines to plot a mesh, and these lines are always adjacent to a triangle. I have enabled the GL_LINE_SMOOTH, but because of the superposition between the two primitives, the quality of the lines turns out to be quite poor. Does anybody know how can I solve this issue?
I send you here a copy of the code where I setup the SharpGL object (I've named it "ControlGL" here):
            ControlGL.ClearColor(VisualizationParameters.ScreenColor.R / 255, VisualizationParameters.ScreenColor.G / 255, VisualizationParameters.ScreenColor.B / 255, VisualizationParameters.ScreenColor.A / 255)

            ControlGL.Clear(OpenGL.GL_COLOR_BUFFER_BIT)
            ControlGL.Clear(OpenGL.GL_DEPTH_BUFFER_BIT)

            If VisualizationParameters.AllowAlphaBlending Then
                ControlGL.Enable(OpenGL.GL_BLEND)
                ControlGL.BlendFunc(OpenGL.GL_SRC_ALPHA, OpenGL.GL_ONE_MINUS_SRC_ALPHA)
            Else
                ControlGL.Disable(OpenGL.GL_BLEND)
            End If

            If VisualizationParameters.AllowLineSmoothing Then ControlGL.Enable(OpenGL.GL_LINE_SMOOTH) Else ControlGL.Disable(OpenGL.GL_LINE_SMOOTH)

            Dim Origen As New EVector3
            Dim Punto As EVector3 = VisualizationParameters.CameraPosition
            Dim Orientacion As OrientationCoordinates = VisualizationParameters.CameraOrientation

            ControlGL.RenderMode(OpenGL.GL_RENDER)
            ControlGL.MatrixMode(OpenGL.GL_PROJECTION)

            ControlGL.LoadIdentity()
Jan 23 at 12:17 PM
Edited Jan 23 at 2:36 PM
In your Initialized control method.. add these two lines at the end of it...
        gl.MinSampleShading(8);
        gl.Enable(OpenGL.GL_MULTISAMPLE);
The 8 might be too high, try lowering it if needed.

Also, GL_SMOOTH only affects the surface of the polygons so it doesn't have that angle look from one polygon next to another. It has nothing to do with the quality of the picture.

EDIT UPDATE :

This is also fully supported extension for video cards that do not have native support for OpenGL 3.0 and newer.

GL_EXT_framebuffer_multisample

Adding this info so you can have a direction to go in, especially when you get into shaders.