I have created a minimap for my game, and I am trying to overlay a line-list to describe the viewport. I'm using manual object to do this, and If I create a TRIANGLE LIST QUAD, with a depth bias of 1.0, while my minimap is also a TRIANGLE LIST QUAD with a depth bias of 0.5, it works and there is an opaque quad where the viewport should be. However, if I change it into a linelist, then the depth bias does not seem to work and I cannot see an overlay on the minimap. Both materials are unlit.
OK I feel like I hack away many times without really knowing what I'm doing. I don't think I understand what's going on. I did get it to work, but I have some questions on why. Here is more info:
first off, I have a gui the gui is an item with identity view/projection and is full screen with transparency. The gui material looks like so:
If I change the minimap depthcheck = false, it doesn't draw, why is that?
Also, the depth bias constant doesn't seem to work if I change it from 0.0/1.0, to a value in-between, why?
Here is a video of it working:
Depth bias isn't constraint to a value in range 0-1, you can try values like 36 or 100.
The problem of depth bias is that it's very unpredictable. Its behavior can change between GPUs and APIs, which is why nobody uses it except as a last resort.
Increasing the Z position is usually a much better way. Depth buffers aare not THAT imprecise.
Disabling depth checks is also another good solution, as long as you set a higher render queue ID so that they are rendered last