0

I am drawing a rectangle using VBO, EBO with GL_TRIANGLE_STRIP drawing method. Now I would like to draw an outline for it but I don't know how. As I understand, I can use the same set of vertices and create an new set of indices for a LINE_LOOP. Do I need to create new vertex shader, fragment shader, and program shader for an outline shape ( As I want different color for the outline )? Thank you so much for your help.

ryanvolap
  • 77
  • 1
  • 8
  • Since you are using OpenGL 3+, I think you would need to create your own shaders as you mention. I know fixed function OpenGL could do it automatically, but the results were not well-supported and pretty anyways. [This page](https://mattdesl.svbtle.com/drawing-lines-is-hard) and [this page](https://www.mapbox.com/blog/drawing-antialiased-lines/) are both webgl articles on drawing lines, but you might still find them useful. Of course, if you are only dealing with rectangles, you could just draw four boxes instead, which should be easier than a general purpose line drawing shader. – CodeSurgeon Jun 24 '17 at 21:49
  • @CodeSurgeon Thank you so much for your help and the links are very useful. I've just found another solution using program pipelines. It is really quick and easy. – ryanvolap Jun 25 '17 at 07:44

0 Answers0