Few questions on mapping -1 reply

Please wait...

Devoted

All i wish is gone away..

50 XP

9th September 2009

0 Uploads

163 Posts

0 Threads

#1 8 years ago

Hi guys! I have few questions related to mapping, can you please help me? 1. How can i make a teleport without playing sounds and effect? (I need very fast movement, so the player cannot understand when he got there :D I'm going to make a labirynth.) 2. A teleport with button? (Player uses a button, and immediately gets teleported). 3. Wet floor shader. (Or just FAKE mirroring (done by prepared reflection map)). 4. A light emitting shader(bitmap + light map). 5. One special thing: A room where I can view another part of the map (like a fake window, and the brush is playing a role of screen.) I have a great idea, and I hope I can make the huge and beautiful map :beer:




Pande

Sexeh like teh gizmo

50 XP

9th April 2008

0 Uploads

610 Posts

0 Threads

#2 8 years ago

1. The sounds are played by the .efx file, you would have to edit the .efx and package it with your map (letting players know of course that you've done this, and do it in a second .pk3 so they can remove it when they are not playing your map) By the way, this won't have the greatest intended effect, you will still be able to see the change just slightly.

2. Link a trigger_teleport entity (draw a brush, cover in system/trigger) to a misc_teleporter_dest. Make sure the trigger_teleport is over your button.

3. You can fake mirroring by creating a 'mask' for your puddle. This is a copy of the floor texture with alpha drawn in. Then render it above the envmap.

If you want a real reflection, you will have to use a portal shader.

"Originally Posted by CalcProgrammer1 You use a portal shader like this:

textures/desert_city_calc/camera { qer_editorimage textures/desert_city_calc/camera surfaceparm playerclip surfaceparm nolightmap portal { map textures/desert_city_calc/camera blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA depthWrite alphaGen portal 2048 } }

Found this shader online, the image is a .tga and is probably transparent somehow. You also have to put a misc_portal_surface object, you can also make a misc_portal_camera if you want the mirror to instead be a TV screen with a camera."

Pay attention to that last paragraph, it describes how to make it into a mirror OR camera (answering question 5).

Essentially, adding 'portal' to your shader renders the portal behind anything added on top. So, you can stack images over top of the portal. anywhere the image has alpha, the portal will show through. Thus, you can make: a mirror with dirt on it, a puddle, etc.

Now here is the important bit. Check out this tutorial for more description: portals

You need to put a misc_portal_surface in front of the shader. It needs to be a certain amount of units at least I believe, but basically just put it in front and it should be fine. Without adding a misc_portal_camera for it to link to, it will act as a mirror. Judging by what you describe, you need a normal misc_portal_surface for the puddle and a misc_portal_surface linked to a misc_portal_camera for the window. The camera is a bad name for it, since in fact you can see around the sides when you move your character around (think Portal (the game) portals). It actually is not fit for tv screens.

One other important thing. ONLY ONE PORTAL per Visibility area. That means that if ever, EVER in your map 2 portals become visible at the same time, you will crash. Sometimes even if you think you've separated the two areas well, it may still find a way to see both. Read: you can't have two puddles... UNLESS:

IF you really need more puddles, you can make two shaders. One portal, one puddle mask, and your usual floor texture. Put q3map_offset 0.5 in the shader for the mask. Now, anywhere you put that puddle it will let the portal show through.

4. A light emitting shader is easy, unless you want light to be only emitted from one area in the texture. In that case, entity spot lighting is the preferred method. Assuming you just want a light that casts from all areas of the image (or at least, most) you will want

q3map_surfacelight q3map_lightRGB (normalized to 0-1, divide your RGB values each by 255 to get the normalized values) q3map_backsplash (percentage of light reflected back to the surface by shader, and distance from which it does so) q3map_nolightmap (if it's a really bright light. Sometimes this makes it look bad if it is not a bright light and you put it in a dark place. q3map_backsplash with a higher percentage value can do a good job instead) I won't go into detail about the shaders you will need, but if you need help with that I am available for PM or post here. I *can* help you get them working, I just don't have time at the moment to post. I may later. Good luck!




Jonny2199

Click >HERE< to find an idiot.

50 XP

18th September 2005

0 Uploads

1,046 Posts

0 Threads

#3 8 years ago

1) Near Seamless Teleport 5) Tutorial on Cameras - it's designed for a teleporter that shows you where you're gonna end up, but just don't use the teleporter bit and it should work. Note that for some reason, the image may appear upside down/sideways in MP/SP. IIRC, giving the camera the key 'roll' and value '180' will make the camera appear right way up. Also, check the 'nosway' or 'noswing' box to make sure that there is no sway in the camera.




Devoted

All i wish is gone away..

50 XP

9th September 2009

0 Uploads

163 Posts

0 Threads

#4 8 years ago

Pande, thank you very much! :D I'll write my shader, and then post it here if I have any problems. P.S. I have another question: How can I make puddles without reflecting the real gamelevel, but just a shader of shiny floor with another bitmap of ceiling(it's swimming and deforming on the real texture)? Edit: I've made a puddle texture. Here is my idea: The puddle texture: thumbnail.png What i'll see (in 50% transparency) in the puddle (the actual reflection). puddlereflect1.th.png The mask for reflection: puddlemask1.th.png




Mr. Wonko

Addicted to GF

50 XP

24th September 2006

0 Uploads

277 Posts

0 Threads

#5 8 years ago
Pande;56485542. Link a trigger_teleport entity (draw a brush, cover in system/trigger) to a misc_teleporter_dest. Make sure the trigger_teleport is over your button.

I don't think you can toggle a trigger_teleport... He wants a target_teleport.




Pande

Sexeh like teh gizmo

50 XP

9th April 2008

0 Uploads

610 Posts

0 Threads

#6 8 years ago

a trigger_teleport is the toggle, all he need do is press use on it. You don't even need a wait time since by the time you could possibly hit it a second time you've been teleported.

If you want to toggle the button's function, either script it or use a target_deactivate and target_activate chain.

For a non-real reflection, simply take out the word 'portal' from the q3map stage of the shader and add a new stage before the mask (puddle) stage with the envmap and tcGen environment

By the way, that mask you posted will not let you just show reflection only where there is white. You actually want to create a .tga of your floor texture and erase parts of it (you can use that alpha mask to do the erasing though).

Also, you will have to align the surrounding non-puddle floor textures with the puddle one.




Devoted

All i wish is gone away..

50 XP

9th September 2009

0 Uploads

163 Posts

0 Threads

#7 8 years ago

I can't understand one really strange and annoying thing. I use windows 7, and when I want to run my custom maps, I can't run them cause JA doesn't actually see them, or the map launches but all textures are missing. It works only when I pack my map into *.pk3 file, and I can't use my assets when they're just in directories. How can I fix that? It's not convenient and It's making me mad.




Mr. Wonko

Addicted to GF

50 XP

24th September 2006

0 Uploads

277 Posts

0 Threads

#8 8 years ago

Enter sv_pure 0 in the console before loading the map.




Devoted

All i wish is gone away..

50 XP

9th September 2009

0 Uploads

163 Posts

0 Threads

#9 8 years ago

I've made it using shaderEd2, but i have a little problem. The texture with puddle is brighter than texture that doesn't use a shader. And it also seems that the puddle texture doesn't use a light O_o Here is my shader and screenshot:

Spoiler: Show
shot0000kd.jpg textures/dclair/puddle_asphalt { qer_editorimage textures/dclair/puddle1.tga surfaceparm playerclip { map textures/dclair/puddle_reflect1 blendFunc GL_ONE_MINUS_DST_COLOR GL_SRC_COLOR tcGen environment } { map textures/dclair/puddle1 blendFunc GL_DST_ALPHA GL_SRC_ALPHA depthWrite } }



eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#10 8 years ago

Your puddle texture probably has brighter dark spots than normal. Use the eyedropper tool in either PS or GIMP and ensure that the edges of your texture (the black/alpha part) do not have any leftover light. (or are RGB 0 0 0)