How Do I Control Z Buffer Depth with Immediate Mode Drawing?
I'm using the following settings:
Draw.LineGeometry = LineGeometry.Flat2D; Draw.LineThicknessSpace = ThicknessSpace.Pixels; Draw.LineThickness = 1; Draw.LineEndCaps = LineEndCap.None; Draw.BlendMode = ShapesBlendMode.Opaque;
Is it possible to make immediate mode calls to Draw.Line and reliably control which lines render on top of other lines?
It seems like the order in which I call Draw.Line doesn't effect the Z Depth of the lines drawn.
Immediate mode draw order will always be the order in which you tell it to draw the lines, so the first Draw.X you call will be furthest back, the last Draw.X you call will be closest/on top
however, Opaque shapes will also write to the depth buffer, so if you draw an opaque line close to the camera, and then an opaque line further behind that line, the closer line will still be on top since it wrote to the depth buffer, so I'm guessing this is what you're seeing! If you want to specifically make sure it's in the order you draw things, then using transparent instead of opaque will do that