2

A line rendered with GL_LINES is visible regardless of how far away from the camera it is, yet its visibility is still able to be obstructed by world geometry.

I recently converted my ballistic projectile rendering code from GL_LINES to lines implemented with polygons, and discovered that projectiles now go completely invisible once they're sufficiently far away from the camera.

Is there a way render lines using polygons, but

  1. Still retain the infinite render distance behaviour that GL_LINES has
  2. Still be able to obstruct the visibility of the line with world geometry


edit: hmmm, couldn't I just "undo" (or dampen) the perspective projection by performing the inverse of it on the model's geometry in the vertex shader? it would stretch the geometry to make it look orthographic, yet still be obstructable by other geometry on the map
Mr. Smith
  • 4,288
  • 7
  • 40
  • 82
  • 3
    [Conservative rasterization](https://developer.nvidia.com/content/dont-be-conservative-conservative-rasterization) might help. – Nico Schertler Jun 25 '19 at 01:55
  • you can obscure fragment depth in fragment shader if its further away then your frustrum far limit set it to some value that is still inside frustrum ... – Spektre Jun 25 '19 at 06:08

0 Answers0