Actually reflecting a player.

archvilell

Newbie
Joined
Nov 22, 2004
Messages
408
Reaction score
0
I know this may sound like blasphemy to a lot of hardcore HL2 fans, but how would I change it... dum dum dum *dramatic reverb* so that I could see myself in a mirror? There. I said it.

Since my mod will be from a Combine point of view, all Combine wear uniforms and masks, so there is nothing to ruin the immersion if you see a Combine unifrom in a mirror. For instance, one of the rooms in my Combine HQ is an interrogation room, and it would be ultra-awesome if I could walk up and see myself.

However, this may be really difficult, since Source (as far as I know) is not set up for that and when I move in front of a mirror, it might look awkward. I don't know if the engine is set up to make a player model move, run, jump, crouch, etc. in front of a mirror. And since the player model would be a metropolice model, I would have to import their skeleton and model to the player.mdl.

I'm not a programming man, and don't pretend to be. This may require a ton of work. Or it may be as simple as commenting out a section of code that forbids the player to see their reflection. Either way, it's just a cool thought I had. Even though I might not throw in that many reflective textures (I might if you could see yourself), I'm striving for detail.

Thanks in advance.

Archvilell
 
Well it'd be rather easy if there's no shader in for that to code a shader into it using the SDK I think?
 
There's two problems you have to get over first.

1) The player mode isn't rendered by default. You'd have to modify the code so that it's drawn and animated.

2) The reflection would have to omit the first-person hands and weapon model.
 
Why would I have to omit the hands and gun? Couldn't the code just put the weapon model I was holding into my hands? (Just a little confused as to why.)
 
the gun you see in the first person is not the gun you see someone else carrying. It's a different model.

The first-person gun is just the left-hand side of a gun (you never see the right) and the forearms/hands. That's it.
You'd have to stop rendering that, and render a third-person model (like in multiplayer)
 
Omitting the hands / weaponmodel shouldn't be difficult if using a 'shader' mirror, as you can pick and choose exactly which objects you want to render.
 
How do I set up a shader mirror? The player model will be a simple metrocop, so keep in mind I would also have to change the player model.
 
I don't know if you answered your question yet but, I do have a suggestion (Although it may or may not work, I haven't tested it yet). Set up a camera pointing wherever the mirror is facing and have the mirror be an output for that camera. I'm assuming it's possible.

Sorry if this is reviving a dead thread, but the question was unanswered.
 
That might work.

I have been watching this thread go unanswered and was about to bump it. Thanks, I'll give that a shot.
 
The camera trick does work, although I have heard that there is a slight dlay so it doesn't look right, but that may be changeable in the code.
 
I'm wondering if camera output works on irregular brushes. Like, a broken mirror, so only the unbroken parts output video.
 
Pesmerga said:
I don't know if you answered your question yet but, I do have a suggestion (Although it may or may not work, I haven't tested it yet). Set up a camera pointing wherever the mirror is facing and have the mirror be an output for that camera. I'm assuming it's possible.

Sorry if this is reviving a dead thread, but the question was unanswered.
That works but only reflects the player if you get the engine to draw a model for the player.
 
Right. You could just put the model in whenever he enters the mirror room, tie it to origin, and remove it once he leaves. Wouldn't want it bogging down the game unnicesarily.
 
Back
Top