0

I draw a polygon and I draw border with using second draw call with drawArrays, can I draw polygon border with fragment shader ? Only with one draw call ?

H. Akkaya
  • 161
  • 3
  • 11
  • 2
    Looks like there are answers listed on the right including [this one](https://stackoverflow.com/questions/18035719/drawing-a-border-on-a-2d-polygon-with-a-fragment-shader?rq=1) and [this one](https://stackoverflow.com/questions/6864748/draw-edges-of-a-polygon-with-opengl-shaders?rq=1) and [this one](https://stackoverflow.com/questions/27760277/webgl-border-color-shader?rq=1) – gman Jul 01 '20 at 01:01
  • Does this answer your question? [Drawing a border on a 2d polygon with a fragment shader](https://stackoverflow.com/questions/18035719/drawing-a-border-on-a-2d-polygon-with-a-fragment-shader) – LJᛃ Jul 01 '20 at 11:57
  • this link exist above I check but there is no geometry shader in webgl. I check some sites but I cant find absolute solution. – H. Akkaya Jul 02 '20 at 09:12
  • You don't need a geometry shader to calculate the barycentric coordinates, you can just add a vertex attribute and rely on the interpolation. – LJᛃ Jul 02 '20 at 17:22
  • You mean calculate barycentric coordinates on cpu and bind to shader as attribute. I did not think this way I understand know. Thanks for that I want to try this. I am very busy but when I try I will share. – H. Akkaya Jul 15 '20 at 06:16

0 Answers0