Underhell is a Source Engine game developed by the Underhell Team in collaboration with We Create Stuff. Underhell Chapter 1 requires ONLY Source SDK Base 2007 installed. No Source game is required.
This tutorial will explain how we implemented a system to workaround the Source Engine's limitation of having only 1 Ingame Camera active at a time, and how we managed to increase the resolution to improve quality of the rendered camera.
Posted by Mxthe on Jul 24th, 2012
It is a known and grieved limitation, the Source Engine allows for only 1 ingame camera to be rendered in a map at all times.
Although you can change the point_camera to render for a func_monitor, you can only have 1 camera rendered at once, and the Resolution of said monitor is set at 256x256, no matter how much you resize your monitor in Hammer.
This is due to Source only having 1 RenderTarget texture, if multiple cameras would be active at once, and one would be pointing at the monitor, it would render the texture within itself, therefore generating an infinite render loop and crashing the game.
So this is why we have implemented a Hammer Keyvalue into the point_camera entity :
This simple Hammer Keyvalue that needs to be added to the point_camera's properties by turning SmartEdit off, allows to set an index for new Render Target textures for the cameras, therefore working around the limitation.
What we had to do, was to make the engine build a new set of render target textures, and in order for us to reference them in the level editor, we created a set of VMTs that calls the corresponding engine texture.
If you open up the VMTs, you will see the following code inside.
IMPORTANT : If no "$surfaceprop" is set, when you buildcubemaps the Monitor will NOT render.
Weird glitch, took us a while to figure it out.
You will notice the index of each _rt_CustomCamera_* refers directly to the number you need to enter in the point_camera's "RenderTarget" keyvalue.
So, if you place a func_monitor with the texture "dev_monitor_512A" applied to it, which is the Index number 3, you then need to have a point_camera with the keyvalue:
RenderTarget : 3
That is how they are linked together, now thanks to those 4 extra monitors, plus the original one, you can have a maximum of 5 monitors in game working independently.
Just avoid putting a point_camera and a func_monitor in the Same Room, especially if they are linked
Monitor Effect Overlay
If you want to add a "ScanLines" overlay to make it look like an actual MonitorTexture, you need to add a $texture2 texture set, and a few proxies effects.
I suggest you take a look at Valve's Monitor VMTs using GCFScape, then open
Then browse to "hl2/materials/dev/"
Take a look at all the "dev_combinemonitors" and "dev_tvmonitors"
They have quite a couple of Monitor Effects there.