Creating a portal
From OpenArena
A Portal teleporter let's you see the other side of the map place to where you're teleporting.
It's an easy process, but it can be difficult in some parts of the process.
[edit] How-to
First you'll need to create the teleporter. You can use a model if you want. Just make sure you have enough space to create the portal brush and the trigger brush.
Create the portal: Make a brush faced with sfx/portal_sfx in one face, and common/nodraw in the other faces. Select it, unselect, and place immediately next to the portal_sfx face an entity misc => misc_portal_surface. You should separate the brush from the entity no more than 32 or 64 px.
Create the teleporter: make a brush with the same size than the previous brush (you can clone it) and texturize it in all of its faces with common/trigger. Right-click on it and select trigger => trigger_teleport. In the destination point of the teleporting place a misc => misc_teleporter_dest on the floor. You can use a target_teleporter or info_null too, just make sure there's enough space for the players to teleport.
Now that the teleport and the portal are made, let's do the trick: in the destination place a misc => misc_portal_camera. Select the misc_portal_surface, then the misc_portal_camera and connect them. Place an info => info_null or target => target_position where you want the camera to watch, select the misc_portal_camera, then the target_position or info_null and connect them. Save your map and test the portal ingame.
You can fix how the camera shows the other side with the property roll on misc_portal_camera.
[edit] Playing with sfx/portal shaders
This is the shader sfx/portal_sfx on oasfx.shader:
textures/sfx/portal_sfx
{
deformVertexes wave 25 sin 3 2 .5 3
portal
surfaceparm nolightmap
{
map textures/acc_dm3/portal_sfx.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
depthWrite
}
{
map textures/oa_fogs/kc_fogcloud3.tga
blendfunc gl_src_alpha gl_one_minus_src_alpha
alphagen portal 1024
rgbGen identity
tcmod rotate .1
tcmod scroll .04 .01
}
{
map textures/acc_dm3/fx_tintedportal.jpg
rgbgen identity
blendFunc filter
}}
You can make your own shaders to apply instead of this one. Remember that OA shaders shouldn't be changed insode of the pk3s!!! Otherwise you'll have package mismatch errors while connecting to pure servers if you want to play online. Also remember to give this shader a different name than sfx/portal_sfx. (Changing the folder name is optional)
Let's look at the code. The main keys here are deformVertexes wave 25 sin 3 2 .5 3 (at the beginning of the shader, it makes the face's vertex to move ingame) and alphagen portal 1024 (in the second stage of the shader)
- If you want to make the face where this shader is applied to be static, remove the first cited line.
- alphagen portal 1024 controls the distance the shader will be watching. You can reduce that number and watch the results by yourself.
[edit] See also
TramDesign explanation and more detailed how-to
WeMakeMaps.com tutorial
