   Custom depth test?  Or, other ways to do closely overlaid geometry
  Is there's a way to do a custom depth test function?  Actually, let me explain what I want to do.  I have two pieces of geometry, which have some faces which are identical - but I want to always have one drawn in front of the other.  For example, a decal, a sign on a wall, or some kinds of clothes.  Let's say A is the main object, and B is the smaller geometry pasted on it.  If I move B a bit in front of A, or scale it up a little, etc., it looks fine, but not close up - the small gap becomes apparent.  If I leave them really in the same place, I obviously get flimmer.  Turning off depth test and controlling the render order so B is always drawn after A works, but not if any part of A might actually occlude B.  example: I make a character and want to give him a tight t-shirt.  I duplicate the torso, trim the polys a bit.  If I scale up the shirt a little to make it draw on top of the torso, when you look closely the collar is floating a bit above the skin.  If I leave the shirt and torso identically scaled, and draw the shirt after the body with depth test disabled, it looks ok - until the character moves his arm in front, and now of course it appears to be behind the fabric of the shirt too.So what I'm wondering is, can I modify the depth test function?  so that the fragment will be drawn if it's depth is less than the depth in the buffer (like usual), or if it's greater, up to a certain threshold.  That way when you have overlaid polys or polys that are "very close" in depth, a particular one always gets drawn on top.   
Depth bias might be what you're looking for. IIRC, the equivalent OpenGL concept is polygon offset.   ;  I'm making this up on the spot, but you could upscale the shirt slightly, and kind of bend in the edges so they go through the body. The your depth test would work fine, and there would be no visible gap.   ;  @hodgeman: bingo!  thanks, it works great.   