Skip to main content
added 337 characters in body
Source Link
Jon
  • 3.7k
  • 1
  • 13
  • 23

Edit:
We tried many combinations of the following and got many, many, equally-disappointing results. OP has resigned to using his backup plan of physically moving the geometry slightly toward the camera before drawing it as wireframe. Link to chat.

A typical use might be to set factor and units to 1.0 to offset primitives into positive Z (into the screen) and enable polygon offset for fill mode. Two passes are then made, once with the model's solid geometry and once again with the line geometry. Nearly edge-on filled polygons are pushed substantially away from the eyepoint, to minimize interference with the line geometry, while nearly planar polygons are drawn at least one depth buffer unit behind the line geometry.
Source

check out this link, waaaaaaaaay at the bottom; the very last thing is a code sample.
They just:

glDisable(GL_POLYGON_OFFSET_FILL);

before going to line mode

glLineWidth also covers anti-aliasing

A sample wireframe pixel shader:

return float4(0, 1, 0, 1);

A typical use might be to set factor and units to 1.0 to offset primitives into positive Z (into the screen) and enable polygon offset for fill mode. Two passes are then made, once with the model's solid geometry and once again with the line geometry. Nearly edge-on filled polygons are pushed substantially away from the eyepoint, to minimize interference with the line geometry, while nearly planar polygons are drawn at least one depth buffer unit behind the line geometry.
Source

check out this link, waaaaaaaaay at the bottom; the very last thing is a code sample.
They just:

glDisable(GL_POLYGON_OFFSET_FILL);

before going to line mode

glLineWidth also covers anti-aliasing

A sample wireframe pixel shader:

return float4(0, 1, 0, 1);

Edit:
We tried many combinations of the following and got many, many, equally-disappointing results. OP has resigned to using his backup plan of physically moving the geometry slightly toward the camera before drawing it as wireframe. Link to chat.

A typical use might be to set factor and units to 1.0 to offset primitives into positive Z (into the screen) and enable polygon offset for fill mode. Two passes are then made, once with the model's solid geometry and once again with the line geometry. Nearly edge-on filled polygons are pushed substantially away from the eyepoint, to minimize interference with the line geometry, while nearly planar polygons are drawn at least one depth buffer unit behind the line geometry.
Source

check out this link, waaaaaaaaay at the bottom; the very last thing is a code sample.
They just:

glDisable(GL_POLYGON_OFFSET_FILL);

before going to line mode

glLineWidth also covers anti-aliasing

A sample wireframe pixel shader:

return float4(0, 1, 0, 1);
added 225 characters in body
Source Link
Jon
  • 3.7k
  • 1
  • 13
  • 23

A typical use might be to set factor and units to 1.0 to offset primitives into positive Z (into the screen) and enable polygon offset for fill mode. Two passes are then made, once with the model's solid geometry and once again with the line geometry. Nearly edge-on filled polygons are pushed substantially away from the eyepoint, to minimize interference with the line geometry, while nearly planar polygons are drawn at least one depth buffer unit behind the line geometry.
Source

Source check out this link, waaaaaaaaay at the bottom; the very last thing is a code sample.
They just:

glDisable(GL_POLYGON_OFFSET_FILL);

before going to line mode

glLineWidth also covers anti-aliasing

A sample wireframe pixel shader:

return float4(0, 1, 0, 1);

A typical use might be to set factor and units to 1.0 to offset primitives into positive Z (into the screen) and enable polygon offset for fill mode. Two passes are then made, once with the model's solid geometry and once again with the line geometry. Nearly edge-on filled polygons are pushed substantially away from the eyepoint, to minimize interference with the line geometry, while nearly planar polygons are drawn at least one depth buffer unit behind the line geometry.

Source

glLineWidth also covers anti-aliasing

A sample wireframe pixel shader:

return float4(0, 1, 0, 1);

A typical use might be to set factor and units to 1.0 to offset primitives into positive Z (into the screen) and enable polygon offset for fill mode. Two passes are then made, once with the model's solid geometry and once again with the line geometry. Nearly edge-on filled polygons are pushed substantially away from the eyepoint, to minimize interference with the line geometry, while nearly planar polygons are drawn at least one depth buffer unit behind the line geometry.
Source

check out this link, waaaaaaaaay at the bottom; the very last thing is a code sample.
They just:

glDisable(GL_POLYGON_OFFSET_FILL);

before going to line mode

glLineWidth also covers anti-aliasing

A sample wireframe pixel shader:

return float4(0, 1, 0, 1);
deleted 142 characters in body
Source Link
Jon
  • 3.7k
  • 1
  • 13
  • 23

A typical use might be to set factor and units to 1.0 to offset primitives into positive Z (into the screen) and enable polygon offset for fill mode. Two passes are then made, once with the model's solid geometry and once again with the line geometry. Nearly edge-on filled polygons are pushed substantially away from the eyepoint, to minimize interference with the line geometry, while nearly planar polygons are drawn at least one depth buffer unit behind the line geometry.

Source

Theoretically, you could draw fill mode normally and line mode with -1 to offset them "out" of the screen/scene. +1 is moving them deeper.

glLineWidth also covers anti-aliasing

A sample wireframe pixel shader:

return float4(0, 1, 0, 1);

A typical use might be to set factor and units to 1.0 to offset primitives into positive Z (into the screen) and enable polygon offset for fill mode. Two passes are then made, once with the model's solid geometry and once again with the line geometry. Nearly edge-on filled polygons are pushed substantially away from the eyepoint, to minimize interference with the line geometry, while nearly planar polygons are drawn at least one depth buffer unit behind the line geometry.

Source

Theoretically, you could draw fill mode normally and line mode with -1 to offset them "out" of the screen/scene. +1 is moving them deeper.

glLineWidth also covers anti-aliasing

A sample wireframe pixel shader:

return float4(0, 1, 0, 1);

A typical use might be to set factor and units to 1.0 to offset primitives into positive Z (into the screen) and enable polygon offset for fill mode. Two passes are then made, once with the model's solid geometry and once again with the line geometry. Nearly edge-on filled polygons are pushed substantially away from the eyepoint, to minimize interference with the line geometry, while nearly planar polygons are drawn at least one depth buffer unit behind the line geometry.

Source

glLineWidth also covers anti-aliasing

A sample wireframe pixel shader:

return float4(0, 1, 0, 1);
deleted 1 character in body
Source Link
Jon
  • 3.7k
  • 1
  • 13
  • 23
Loading
Source Link
Jon
  • 3.7k
  • 1
  • 13
  • 23
Loading