The reason your renderer is rendering “behind” the JumpyJetRenderer is because the default depth
for the SpriteBatch.Draw
methods is 0
. 0
being the closest to the “camera”/“screen” the bigger the number the further back it is. The JumpyJetRenderer appears to user depth 0,1, and 2. which means you can’t get in front of it. I won’t get into how depth stencils work. But you have several options, two of which you could just copy & paste:
- Change the JumpyJetRenderer so the
depth
is further back. Have a look at the Pal0Depth
etc. constants.
- Change your renderer so it clears the depth buffer. Meaning nothing previously drawn (this frame) will be “in front”.
rdc.CommandList.Clear(rdc.CommandList.DepthStencilBuffer, DepthStencilClearOptions.DepthBuffer);
- Change your renderer so the spriteBatch “ignores” depth.
spriteBatch.Begin(rdc.GraphicsContext, depthStencilState: DepthStencilStates.None);
- Change your composition so it takes care of the depth for you. You can do “layering”. I have only done this for built in render features. Not sure best way to go about it for your current situation. Above options probably easier.