View Full Version : Draw line with polygon in opengl

Ahmed Shaban
12-22-2017, 03:26 PM
I wanted to draw polygons with lines at boundary to give good appearence.

What I have tried:
lines drawn first by "PrimitiveType.lines" then polygons drawn by "PrimitiveType.Triangles" and enabling depth test + DepthFunction.Less + PolygonOffsetFill

I have two problem.

1.when zoom out, the polygons becomes small as requied but lines has fixed line width that covered all the drawing (zoom by increse orthognal view size). I need to make lines disappear or become very small width when zoom out.
2.Lines behind a polygon are not displayed as I enabled depthfunction to be less. however lines that are too close (0.005f) benhind polygons appear with hidden pattern. I need to make all not displayed if behind polygon.