How can I create a "Visiblity bubble"?

Well, I’ve tried lurking arround the forums and Answerhub for a answer that might help me.

I’ve implemented a Ray trace to figure out which walls in my scene is between the player and the camera, and turning the visiblity on or off for the complete wall if i recieve a hit. Thats fairly straight forward.

However, this fills my practical needs, but not my estetic needs, I would like to instead create a sort of “Visiblity bubble” arround my character, so that when I for instance enter a house, I get a sort of x-ray radius arround my player.

I figured I would need to implement some sort of material / shader to solve this, but I don’t even know where to begin tackling that.

Any one in the community that have been faced with any similar challange, that might help shine some light on this.

  • I have been peeking arround at Unity’s forums to see If any one have created something there, but I don’t really understand how to translate the examples to Unreal Engine.

Thanks!

An example of how it Might look

http://img15.hostingpics.net/pics/456471visibilitybubble.jpg

I would try accomplishing that with 2 cameras with a similar set up, one rendering the exterior only scene and the other rendering only the interior of the room your character is currently in. If you render both scenes to textures you can then use a final pass with a “bubble” or any other fancy mask to blend the interior image onto exterior.

Another way without using render-to-texture could be using a stencil buffer. First you would draw the exterior with no stencil test, then your “vision bubble” geometry into the stencil buffer, then the interior with stencil test enabled. This is probably harder to achieve in UE (no idea if stencil buffer is even supported) but the RTT approach should be easy.