SpriteRenderer & Immediate-Mode Drawing rendering order
First off, just want to say awesome work on the asset!
So I'm having a bit of trouble understanding how I would modify the order my Immediate mode lines are drawn in in order to make them drawn behind the sprites in my game. Working with the Line component there is no issue as I can modify the layer / order values in the inspector, however when drawing my lines in immediate mode I'm quite stumped as to how to move forward.
Here is the code I'm using to draw my lines in my game. (Sorry for the image - just realized there was a code format button)
Any help here would be awesome, thanks so much in advance!
if you want to draw behind transparent objects, then you need to insert the draw command before transparent objects are rendered. There is unfortunately no other more granular way to sort them, unless you use components instead, or use opaque shaders that write to the depth buffer
anyway! Draw.Command has a second parameter where you specify when during the render process these shapes should be drawn. In your case, you'll want to draw at CameraEvent.BeforeForwardAlpha, which will make these lines be behind any other transparent objects in your scene