GtkRadiant Editor Manual


Tools 4: Working with Textures

There are three skill and knowledge components to working with textures as they regard Quake III Arena. They are Texture creation, Texture Manipulation, and Texture Application. Only the third, Texture Application, is absolutely necessary for making maps. You need not master all three.

Texture Creation: Making new Assets

This is covered earlier in the manual.

Texture Manipulation: Shader Overview

Technically, each texture already has a default shader that passes it through the pipeline to appear much as it does in the graphic program that made it. A shader is a short script, separate from the texture file, that the game engine uses to make further adjustments to the texture's appearance or function. The shader is to Q3A what the surface properties flags were to Q2, only ever so much more powerful. If you plan on creating your own textures, you should get to know and understand how shaders work. The Q3A Shader Manual contains the information you need.

Shaders and Multi-Pass Texture Effects
(Drawn from an original essay by Small Pile of Gibs)

Shaders give the mapper control over special graphics effects that require multiple redrawing passes before they are finally displayed on the game screen. Every shader that changes the visual component of a texture uses these "Multitexture" effects. Multitexture is ON by default in Quake III Arena. It is turned off with the cvar, "set r_ext_multitexture 0 (entered in the console or bound to a key) - see the Debugging section in this document for more details.

To understand how multitexture works, you need to understand how the Quake III Arena graphic engine renders a scene. All the faces you see in Quake III Arena are made up of triangles - you can see this by using the cvar command "r_showtris 1." Initially, each triangle adds one to the "tris" number in r_speeds (the numbers that are used to estimate whether a scene is too complex). With every frame that Q3A "paints", it draws triangles onto the scene in layers, starting at the back of the scene and drawing every triangle visible until it reaches the front. It takes time to draw each triangle. If a triangle is painted with a texture that is "see through" in some way (either transluscent, transparent, or containing cut-outs), any triangles seen through that triangle must be redrawn one additional time for each stage in the the shader. If a single transparent triangle takes up the whole screen, for example, a glass window - The whole area of the screen has to be redrawn. Each triangle of glass takes an entire screen worth of "overdraw" and each extra stage on the glass adds another screenful, which is why glass can be such a big framerate hit.

The simplest form of multitexture is a Lightmap. In most cases, the Q3A engine first draws the lightmap (precalculated light and shadow information). Then, on top of that, it adds in the information from the texture art specified for that triangle using a special effect (blendfunc filter) - which blends the lightmap with the texture to make areas of the texture look light or dark. Using the cvar command "r_vertexlight 1" (Vertex Lighting instead of Lightmaps) stops Q3 from drawing the lightmap triangles (which is why many gamers use vertex lighting to gain additional playing speed).

Every extra stage in a shader is an extra triangle drawn over and blended with the first triangle in a special way. Like the lightmap example above, each additional stage requires an extra triangle to be drawn for each frame. On certain 3D accelerator cards (like the TNT - TwiN Texture), the multitexture effect cancels out the real cost of the first pass of blending. The blending for the first additional stage is done before the triangle is drawn. However, if the shader takes 3 stages (like all the shiny metal effects) it costs an extra triangle for every triangle it is used on. Every extra triangle used adds a triangle to the r_speeds triangle count. Because there are cards that don't automatically handle this first blending pass, the map maker needs to occasionally check his r_speeds with the multitexture turned off.

Texture Application: Texture Handling Tools

These tools manipulate textures within the editor. They do not create textures or shader scripts.

View Textures
This is only used in the four-view and floating windows modes (as set in Preferences). It brings up the Texture selection window (also accessible from a folder tab). If the Entity window is open, you may need to click on a map view window first for the "T" command shortcut to work.

Hide Unused
This option affects the content of the Textures window. It filters the contents so that only those textures currently in use in the map are displayed in the window.

Show All
This command affects the content of the Textures window. It "un"-filters the contents so that all the texture directories previously loaded during the mapping session are re-displayed.

Surface Inspector

This brings up a pop-up dialogue box. This is one of the more complicated interfaces used during map development and may take some getting used to.

Texture
This is the path/name (beginning in Textures directory) for the texture. You can copy from this field or paste into it. If you know the pathname of a texture, you can enter it here. It will load without having to first load the entire directory that contains it.

The next five commands work on both patches and brushes. However, the results of applying a Horizontal Shift to a brush and to a patch may be substantially different. When working with patches, the numbers in the fields do not change … although the texture on the map component may be changing.

Design Note: When a curve patch butts flush up against a piece of solid geometry, as if it were an extension of that geometry, it may be difficult to align the textures exactly. In fact is often extremely difficult to align a texture on a patch with the texture on an adjacent geometry brush. It works best when the dimensions of the patch are an exact multiple of the dimensions of the texture being used. Otherwise, you may want to consider designing your architecture in such a way that it is logical for a new texture to begin at that point. Use your judgement.

Horizontal Shift
This allows you to change the Horizontal texture offset (position of texture on a surface). You can type an offset value into field or use the scroll buttons on the right to shift the texture. If "Surface Inspector Increments Match Grid" is set in Preferences, the scroll increments will move a number of pixels equal to the grid size.

Vertical Shift This allows you to change the Vertical texture offset (position of texture on a surface). You can type an offset value into field or use the scroll buttons on the right to shift the texture. If "Surface Inspector Increments Match Grid" is set in Preferences, the scroll increments will move a number of pixels equal to the grid size.

Horizontal Stretch This allows you to change the dimensions of textures as they are mapped into the world. You can type a size value into field or use the scroll buttons on the right to enlarge or reduce the texture. The default value is 0.5. This gives a presentation in the game world of two pixels for each game unit. A Horizontal Stretch value of 1.0 would double the amount of area covered by a single repeat of the texture. Of course, doing that also reduces the apparent resolution of the texture by half (can you say blurry?)! Making the stretch value a negative number horizontally flops the texture's normals (i.e.; flops the texture left to right).

Design note: Textures are "projected" onto brush surfaces. This means that if a surface is angled, the texture stretches to fit the space upon which it is projected. To make the texture look "unstretched" you need to change the dimension so that it looks correct when stretched. Example: If you want to map a texture on a 45-degree angle, it should be scaled to 0.35 along the direction perpendicular to the axis of the angle.

Vertical Stretch This is the same as for the Horizontal Stretch, but along the vertical axis. Making the stretch value a negative number vertically flops the texture's normals (i.e.; flops the texture up and down).

Rotate This rotates the texture around the center point of the brush (or patch). If the texture is not centered on the map component, the rotation will not necessarily look correct. The increment of rotation is set by the value given for the Rotation Inc field on the Preferences window. The default value is 45 (degrees), roughly 1/8 rotation around the axis.

Texturing

This next grouping of commands in the lower left corner of the window provides two separate sets of buttons. The top set deal with texturing geometry brushes. The lower set is for texturing curve patches.

Find / Replace
This feature allows the user to replace a texture within a single brush, a set of selected brushes or globally throughout the entire map. Selecting the command from the menu opens up a dialogue window. The top line is for the texture path and name of the texture to be replaced. The second line is for the texture to be used for replacement. Several checkboxes allow fine control over what, exactly, is to be changed. This command does not respond to UNDO. If you accidentally mistype a texture name in the replace line, you will need to enter it again (as mistyped) on the find line and then enter the correct texture on the replace line.

Texture replacement is global (throughout the map) unless the selected checkboxes state otherwise.

Step-by-step for replacing a texture on a brush face (if live update is not used).

Texture Lock
When this option is checked, textures stay locked in position on the brush as brushes are moved around the map. If unchecked, the texture appears to shift across the brush, because they are fixed to the world, not the individual brush.

Directory List…
Opens a dialogue box listing all texture directories currently recognized by the editor. Hi-light a directory title then click on the "Load" button. The textures in the selected directory will be loaded into the Textures window.

Shaders
This command loads or reloads all the .shader scripts recognized by your shaderlist.txt file. When you change and save a shader script, execute this command, then reload the affected texture directory to see any changes. When checked, this command surrounds all shader-manipulated textures in the Texture window with a thin white border.

Texture Directories
This is not a command. The entries at the bottom of the Textures Menu are the names of the available texture directories. Clicking on one loads the contents of the directory into the Texture window.

Texture Shift Key Shortcuts
A brush, brush surface, or curve patch must already be selected before using these shortcuts. This feature closely copies the function of the Texture Shift fields and scroll bars on Surface Inspector pop-up window. If Snap to T is selected in preferences, then the texture shifts in pixel increments equal to the current grid setting. Shifting textures on curve patches may produce unexpected results.

Texture Rotate Key Shortcuts
A brush, brush surface, or curve patch must already be selected before using these shortcuts. This feature closely copies the function of the Texture Rotate field and scroll bar on Surface Inspector pop-up window. The texture rotates in degree increments set in Preferences. Rotating textures on curve patches may produce unexpected results.

Texture Scaling Shortcuts
A brush, brush surface, or curve patch must already be selected before using these shortcuts. This feature changes the scale of the texture (the amount of area that a single instance of the texture covers). The texture scale seems inconsistent, except that opposite directions appear to cancel each other out. The amount of increase delivered by the first use appears to be about a ratio of 1:15.

Using Interactive Textures

Interactive textures are the shader-manipulated textures that have an effect on game play, not just the appearance of the map. There are two classes of Interactive Textures: Special Content Textures and Texture Entities. For more detail and instructions regarding shader manipulation of textures, refer to the Q3A Shader Manual.

Special Content Textures Special content textures are textures where the "surface" parameters of the texture actually change the physical nature of the geometry brush and in so doing, affects the play of the game.

Water
Water is a content parameter that allows a player to "swim" inside a geometry brush, causes a pulsing visual distortion of the underwater geometry, and prompts the game engine to draw bubbles as projectiles pass through it. A player can only remain under water for a short time (without a battlesuit) and then begins to drown.

Water usage rules:

Fog Fog content is used to block or diminish player vision and provide "atmosphere" for a level. Like water, fog can affect game performance, especially if one can see additional shader effects within it. The following information is taken from the Q3A Shader Manual regarding fog creation and usage.

fogparms <red value> <green value> <blue value> <distance to Opaque>
This surface parameter (or "surfaceparm") defines the contents of the fog.
Note: you must also specify "surfaceparm fog" to cause q3map to identify the surfaces inside the volume. Fogparms only describes how to render the fog on the surfaces.

<red value> <green value> <blue value> These are normalized values (number range from 0 to 1). A good computer art program should give you the RGB values for a color. To obtain the values that define fog color for Quake III Arena, divide the desired color's Red, Green and Blue values by 255 to obtain three normalized numbers within the 0.0 to 1.0 range.

<distance to opaque> This is the distance, in game units, until the fog becomes totally opaque, as measured from the point of view of the observer. By making the height of the fog brush shorter than the distance to opaque, the apparent density of the fog can be reduced (because it never reaches the depth at which full opacity occurs).

Fog usage rules:

Lava
Lava content, for most practical purposes, is a variation of water content. The damage that it does to players in contact with it is defined by game code and cannot be directly affected by the map designer.

Slime
Slime content, for most practical purposes, is a variation of water content. The damage that it does to players in contact with it is defined by game code and cannot be directly affected by the map designer.

Texture Entities
There are a number of shader-manipulated textures that are used in an entity-like fashion. The shader files that manipulate the textures are what give them their game properties. These are the ones that id used and their relevant properties.

Areaportal
Color: Opaque Red Orange
Location: (textures/common/areaportal)
The bsp tool uses areaportals to create hard, visual breaks between areas in the map. Until triggered, the areaportal blocks geometry behind it from being drawn or seen. The area portal brush should be a thin (2 to 4 units thick) brush. It should touch all the brushes that form the hull of the opening being portalled. It must be placed inside a door. The opening of the door triggers the portal function. The closing of the door returns it to its former state. The areaportal texture must completely seal off a volume from another volume (although this can be in conjunction with other areaportals). If a door is being used to block off an area from view, consider placing an areaportal brush inside the door. Example in Quake III Arena: All the doors out of the central courtyard in Q3DM12, The Dredwerkz, are areaportalled.

Caulk
Location: (common/caulk)
Color: Opaque Pink
Game Function: Caulk, the miracle texture. It blocks vis. It seals the world off from the void. It doesn't draw (so it doesn't add to triangle counts). It keeps curves from competing with textures behind them. It looks like hell if you see it in your world. From the View menu (View > Show > Caulk), you can toggle on and off the display of caulk brush sides.

Design Tips: When you build a brush entity (a.k.a. b_model), mark all the brush sides that you will never see with caulk. Otherwise, the game draws every one of them. Even if you're only making a one-piece door, mark all the non-viewed sides with caulk. The same holds true for detail brushes. If you can't (or won't ever) see a brush face on a brush that's been marked as detail, paint it with caulk. Next, whenever you build a curve, try to build the brush geometry immediately behind it out of caulk. Finally, look around your map for brush faces that you suspect are being drawn, but are never seen: door pockets, bars, underneath bridges or very low railings and so on. It may sound like work, but attention to detail like this buys you both the appearance of greater geometric detail in the map AND faster game running speed.

More Design Tips: Finally, and this should be used with great care, a caulk brush can be used to create an invisible support for entities. If you place a very thin caulk brush floating above a surface that would otherwise not support an entity (example: a grate made of clip brush), the brush will not draw in the world, but will support the entity. The reason for this is that SUSPENDED entities are not "seen" by bots unless they can be reached by a jump pad.

Clip
Location: (textures/common/clip)
Color: Transparent Red
Game Function: If you look at a professionally made map, quite often you'll see that nearly every bit of wall surface is covered in a transparent red texture called "common/clip." Clip is a nondrawing texture that blocks player movement. Clip does not block weapon fire. Entities, such as ammo or weapons, are not supported by clip brushes. If placed or dropped on a clip brush, they will pass through them.

Design Tips: Place clip brushes to smooth the passage of players through the world. This could mean creating a slope that allows the player to slip past a piece of architectural trim, or filling a window to keep players from getting into it. It can be used to create an artificial ceiling that prevents players from flying or jumping too high.

Cluster Portal
Location: (textures/common/clip)
Color: Translucent lavender
Game Function: Works like an area portal, but for the bot navigation file only. Cluster portal is used by the bspc utility to subdivide the map into smaller areas for calculating bot navigation. Appendix C: Bot Navigation Files contains the specific details for using cluster portal texture entities.

Cushion
Location: (textures/common/clusterportal)
Color: Translucent pale aqua
Game Function: A player falling on this does not take damage. They also don't make a "landing" sound, so use with caution.

Do Not Enter
Location: (textures/common/donotenter)
Color: Transparent Pale Orange
Game Function: It is a tool used to solve bot navigation problems. Use it like a clip brush, but sparingly. When you observe bots doing stupid things in your map, try to block off the area with this texture. The Bot Navigation Files appendix contains the specific details for using the Do Not Enter texture entity.

Hint
Location: (textures/common/clusterportal)
Color: Transparent Yellow Green
Game Function: Helps determine the vis portals. It is used as a suggestion to the compiler during the vis phase, when the world is subdivided. Generally speaking, they are used to correct vis problems, whose chief symptom is the "hall of mirrors" effect seen during game play. These can often be corrected by careful placement of a hint brush. If you fill the volume where the error is seen or the volume adjacent to it, the problem may be corrected in the next compile. This is really more art than science.

Invisible
Location: (textures/common/noimpact)
Color:
Game Function: This was used to create a surface that would be marked by weapon fire, but would not be drawn in the world. This was created specifically to resolve a problem where func_static brushes were being used to replace floor textures that marked the location of weapons in Q3DM8. Because the rocket launcher was located in different places between the team and the deathmatch games, the designer wanted to make floor markers that would not only change between game types, but would be marked like adjacent floor pieces.

Nodrawnonsolid
Location: (textures/common/trigger)
Color: Opaque light yellow
Game Function: This is the same as nodraw.

Noimpact
Location: (textures/common/noimpact)
Color: black
Game Function: Used to create a surface which does not block weapon fire.
Weapon fire will pass through this. This usually used as a shader key on other textures.

Origin
Location: (textures/common/origin)
Color: Opaque Orange
Game Function: Used to create origin point in moving b_models, such as trains, plats, and rotating objects. This texture, applied to a square or rectangular brush, is used to create the point of origin for moving b_models, such as trains, plats, and rotating objects. It is used by func_trains as the point that passes through path entities and the source for sound attachment

Skip
Location: (textures/common/skip)
Color: Transparent yellow
Game Function: Do not use in Q3A. This texture was used in Quake 2 maps to discard sides of hint brushes. It is nonfunctional in Q3A.

Slick
Location: (textures/common/trigger)
Color: Translucent Pale Blue
Game Function: Not stick coating for map surfaces. Reduces friction. Use like a very thin clip brush over surfaces you want to be low friction.

Trigger
Location: (textures/common/trigger)
Color: Transparent Dark Yellow
Game Function: Used to make trigger brushes.

Weapon Clip
Location: (textures/common/weap_clip)
Color: Transparent Red
Game Function: This version of the clip brush only stops weapon projectiles from passing through it. No marks are left on the surface.
Design Tip: Use to create clip surfaces for map object models.

Back | Home | Next