c++ - OpenGL : drawing line using degenerate triangle -


in engine, want avoid having line, , separate triangle types. want draw lines using triangle 2 verts identical. in opengl, triangle wont displayed because has 0 area, , therefore can't cover pixel.

internally, @ driver level, opengl line drawn using degenerate triangle, , different rasterization rule used draws @ least 1 pixel per scanline.

d3d had option set rasterization draw first pixel per scan line--effectively accomplishing want in d3d.

but how can opengl? don't see command allow change rasterization rules.

well did exact thing by, of 3 vertices necessary, using first 2 start point of line , using glpolygonmode(gl_front_and_back, gl_line) @ start of line rendering object , glpolygonmode(gl_front_and_back, gl_fill) @ end.

combine appropriate enabling , disabling of face culling, , you've got line renderer still uses triangle set up.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -