3D line-of-sight effect

Just to clarify, by “line of sight” I mean a visual effect in 3rd person games that lets the player see only what the character can see. E.g. like in Nox:

As far as I know, in 3D this kind of effect can be done only via some sort of omnidirectional shadow technique. I’m considering two variants:

  1. Every “invisible” fragment is simply made black. Pros: the objects look whole. Cons: “invisible” parts can still occlude the “visible” ones.
  2. Every “invisible” fragment is discarded. Pros: visible information is actually limited to what character can see. Cons: a somewhat weird look, resembling the results of a 3D scan:

Either way, it would require to:

  1. render to a “visibility shadow cubemap” a certain subset of opaque objects (at least excluding the character herself), ignoring their shadow-cast flags;
  2. in every object’s fragment shader, sample the cubemap and either discard the fragment or modify the final color;
  3. not render the “visibility shadow” as a normal shadow.

However, it seems like JME’s default RenderManager and shadow system aren’t very suited for this kind of task. Would I have to create custom ones (likely duplicating lots of code), or can there be an easier way?