Originally Posted By: Rackscha
can you roughly explain how it works? just interested.
*magic* shocked


(I hope my explanation isn't that bad)

Yes the player gets teleported, but its not 'just' the teleporting!

I'm using something similar to the system in portal.
I've got 2 Views.
One of them is placed on another position in the Level.
It is exactly the same as the room you start in, but it has a tunnel in it, which leads to a second room.
The second View has also got the same orientation as the first.

At this point I make use of my HDRR shader pipeline.
Without it I couldn't use colors brighter than 1.0 or darker than 0.0
Theres a portal entity (portal.mdl). I set the color (with a shader) to RGB -1.0, 0.0, 0.0

Its pretty safe because it can't happen accidently that an entity has got exactly this color.

In one of the shaders I scan if the pixel color is -1.0, 0.0, 0.0
if so, then the pixel gets the color of the second view.
if not, then it stays the same.

With this way, the 'other' room is only visible through this 'portal'.
You can see the effect pretty good, when scaling down the portal.mdl wink

without this It would be impossible.

for the teleport i just use 2 empty models.
If you're near enough you get teleported.

I also had to work a lot on the teleporting to make it 'seamless'
It was caused by my player script which smooths the movement and also adds a force to the player, if the ground below is moving.

that's it.

But even with knowing the 'trick'... it feels strange to look at things like this crazy

EDIT:
Quote:
But there is a small cam stuttering when teleporting between the rooms
I don't see something like that smirk
I only see a black seam at the right end of the portal model.
But thats a pixel-position problem with the shader.

Last edited by Kartoffel; 07/11/12 21:22.

POTATO-MAN saves the day! - Random