The problem with that is that the character has overlapping polygons and will z-fail parts of himself.
You can do it with a stencil check like this:
1. Draw the whole scene (without your char)
2. Draw your character without writing him to the buffer, set a stencil bit when the z-test failed (=is hidden by something).
3. Draw your character normaly.
4. Draw the bounding box of your char or fullscreen quad, turn stencil test on and darken the area where the stencil test succeed (i.e. blend a dark color with the background).
In OpenGl you should look into stencil opertions: chapter 10, section Stencil Test
0) From a clear colour/stencil/z
1) Draw player to stencil buffer, setting bit to non-zero
2) Draw everything the scene (not the player) as per normal, ignoring stencil
3) Draw player again, but set stencil operation to set zero if z-test passes, but leave it alone if it fails
4) Draw fullscreen quad where the stencil buffer is not zero.