Is there anything like polygon offset for GL_LINES?

Posts: 1,199
Joined: 2004.10
Post: #1
Subject says it all. I'm doing solid wireframing, and pushing the solid geometry back into the depth buffer before rendering the wireframes works, but causes noticeable artifacts when rendering shadows.

Ideally, I'd just "pull in" the line fragments, but GL_POLYGON_OFFSET_LINE doesn't seem to work for GL_LINES primitives... unless I'm missing something. My understanding is that that's for when you've set glPolygonMode to GL_LINES.

Any ideas?

In principle, I could write a fragment shader to do it, but I don't know how I'd modulate the outgoing fragment's depth in a manner consistent with glPolygonOffset.
Quote this message in a reply
Posts: 1,140
Joined: 2005.07
Post: #2
I can't see anything except for polygon offsets. The only thing I can suggest is to change the fill mode to GL_LINE, and draw polygons. Other than that, the only solution, AFAIK, is to write a fragment shader to handle it for you. Unless you can re-work your rendering pipeline so everything but the lines are offset the way you need them, in a kind of reverse logic.
Quote this message in a reply
Posts: 1,199
Joined: 2004.10
Post: #3
I thought about changing the fill mode, but I'm not actually rendering triangle edges, but specific edges generated by analyzing the geometry.

Anyway, it's not really a big deal. My rendering looks better with wireframing turned off anyhow Rasp
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Polygon budgets Kerome 1 4,073 Mar 7, 2010 04:55 AM
Last Post: mikey
  glut polygon winding strangeness OptimisticMonkey 2 4,935 Sep 7, 2009 06:27 PM
Last Post: OptimisticMonkey
  Getting the Normal for a polygon. Jaden 3 7,992 May 1, 2009 01:47 PM
Last Post: Nosredna
  2d Polygon Intersection bizimCity 6 9,435 Aug 31, 2006 05:29 PM
Last Post: reubert
  Adding Height Segments to a polygon..!! leodeus 13 10,196 Oct 24, 2005 08:24 AM
Last Post: leodeus