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.
HAMMER
So this is why we have implemented a Hammer Keyvalue into the point_camera entity :
Point_Camera Keyvalues :
Rendertarget : 1
Rendertarget : 2
Rendertarget : 3
Rendertarget : 4
Which are, respectively :
256A
256B
512A
512B
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.
.VMT
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.
materials/dev/dev_monitor_256A.vmt
materials/dev/dev_monitor_256B.vmt
materials/dev/dev_monitor_512A.vmt
materials/dev/dev_monitor_512B.vmt
If you open up the VMTs, you will see the following code inside.
dev_monitor_256A.vmt
"UnlitGeneric"
{
"$basetexture" "_rt_CustomCamera_1"
"%tooltexture" "dev/dev_monitor"
"$surfaceprop" "glass"
}
dev_monitor_256B.vmt
"UnlitGeneric"
{
"$basetexture" "_rt_CustomCamera_2"
"%tooltexture" "dev/dev_monitor"
"$surfaceprop" "glass"
}
dev_monitor_512A.vmt
"UnlitGeneric"
{
"$basetexture" "_rt_CustomCamera_3"
"%tooltexture" "dev/dev_monitor_512"
"$surfaceprop" "glass"
}
dev_monitor_512B.vmt
"UnlitGeneric"
{
"$basetexture" "_rt_CustomCamera_4"
"%tooltexture" "dev/dev_monitor_512"
"$surfaceprop" "glass"
}
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
"/../steamapps/source materials.gcf"
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.
Wow keep em coming!, Last question will the gore system be implemented into the prologue? P.S. sorry for asking so many questions.
Yeah, Prologue will be re-released alongside Chapter1, with all the new features.
Nice job Mxthe, can't wait this sweet release :D
It's great to see something like this from a coder. Normally when the word "Coder" comes into mind for game design, is something like "Advanced AI", "Bad-*** Weapons", or anything along those lines. Pretty neat to hear something that benefits the development aspects of a mod rather then mindless fun(Not that there's a problem with that).
Oh woups, I meant to type this comment on another tutorial page for Underhell. Well I sure look stupid in front of anyone that's read this page before I typed this.
Well I could always delete your comment if you'd like, but where would be the fun in that ?
great !!! i can't wait for the release of the Chapter 1 ! because i'm waiting it and waiting , waiting is hard ;)
Yes, waiting is very hard.
Underhell was truly a breakthrough in the stale FPS genre and I've been waiting ever since for EP1. :P
But were almost there. ;)
yes were almost ther you right and the expectation is closing right ?
Whoops, I accidentally voted down your comment! I meant to vote up, my appologies!
Thanks, this is pretty useful.
redalpha01 has an interesting point though, since Portal's portals can essentially have a camera pointing at its own monitor without crashing the game. Even if it's a different version of Source, I'd be interested as to how that works.
when are you going to realese underhell weve been waiting for months now
can you atleast giveout a little gameplay and some scares on your youtube channel
This comment is currently awaiting admin approval, join now to view.
So does this only work with your mod, not with vanilla HL2/Ep1/Ep2? Because I just tried it in unmodded HL2/Ep1/Ep2 and I couldn't get it to work, I kept getting the purple-black checkerboard textures ingame.