Working with Textures


There are three skill and knowledge components to working with textures as they regard Anachronox. 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.

Brush Primitives
With the release of version 192, the Q3Radiant editor takes a new direction in the way textures are mapped to the surfaces of brushes. The texturing format will roughly be the same as the way textures are handled on curve patches. While there are no changes to the user interface within the editor, you should see a change in the way textures behave on brushes during transformation operations like move and rotate. Because textures are mapped to the S and T coordinates of a brush (as they are with curve patches), locked textures will now maintain their positions on brushes when they are moved or located. Even complex rotations should now be possible without the textures going askew. Checking the Brush Primitives checkbox turns on this feature. (Menu: Project Settings… > Use brush primitives in map files). Once you change a map to Brush Primitives, you cannot go back to the earlier method of texture mapping with that map. The prudent mapper makes backups before making major changes to projects.

Not sure if the new brush primitives are compatible with Anachronox. More testing on the subject needs to be done.

Texture Creation
Any combination of graphic programs and plug-ins that can output a 24 bit MS windows compatible Targa (.tga) or JPEG (.jpg) graphic file. If you plan to make textures that will have an alpha channel component , you must have a program that can create 32-bit art with that fourth channel.
Adobe PhotoShop has the ability to easily create alpha channels. Paint Shop Pro from JASC (v5.0+) can also make an alpha channel by creating a mask and naming it “alpha”.
Generally speaking, regardless of the program used, we found it best to do most of the art manipulation of the alpha channel in a separate layer or file and then paste it into the alpha channel before saving.

Rules
Follow these rules when creating textures for the Anachronox engine:

Guidelines
The following are some things the id designers learned about textures.

Texture Manipulation
Texture manipulation on b_models is done by creating an Anachronox Texture Definition file. Texture Definition files allow you to replace existing map textures with a proceedural texture. Procedural textures provide interesting visual effects by modifying the color values of a texture in real time. Use Procedural textures to create texture special effects; Lava, animated snow on a television, blinking controls on a terminal, etc.. Some procedural textures can even be controlled from APE, which can greatly enhance the interactive feel of the game.
If you plan on creating your own textures, you should get to know and understand how proceedural textures work. See Visual Effects/Procedural Textures for an explaination on how to manipulate textures.

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

Escape(ESC)
This is the all-purpose deselect key. Use it to back out of operations you don't want to complete or to stop working on a brush face, a brush, a patch, or a group of brushes or patches.

View Textures(T)
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 Texture/Console/Entity window). If the Entity window is open, you may need to click on a map view window first for the "T" command shortcut to work.

Show in Use(Menu: Textures->Show in Use) (U)
This command 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(Menu: Textures->Show All) (CTRL+A)
This command affects the content of the Textures window. The effect "un"-filters the contents so that all the texture directories previously loaded during the mapping session are re-displayed.

Surface Inspector(Menu: Textures->Surface Inspector) (s)
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 the anoxdata/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 "Snap T to 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 "Snap T to 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.

Value
This is used in conjuction with the light Surface Flag to designate the amount of light this face puts off.

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.

Surface flags and Content Flags
One of the coolest editing options in AnachroRadiant are the surface properties and content properties. They allow you to define in gme properties about a brush or face. Anachronox surface flags are defined in ref_gl.dll and content flags are defined in intellinox.dll for any interested programmers.

Differences between a surface property and a content property.
The main difference between surface and content properties is that surface properties can be applied to any number of a brush's faces. Content properties must be the same on every face of a brush.

For example, you could mark one brush face as light, or two face, or three, etc, but for a detail brush, every face must be marked as detail, or you will get an error when you compile the level ( Entity x, Brush x: mixed face contents ) Thanks autolycus for the above info.

What Surface Flags do

What Content Flags Do

Greyed out Surface and Content flags are those originally supported by the quake II engine, but appear to be unused in Anachronox. More testing will be conducted to determine if this is correct.


Find / Replace(Menu: Textures->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.

Texture Lock(Menu: Textures->Texture Lock)
Opens a Pop-up window with two options for "locking" texture shifting during brush or patch movement.
NOTE:
If you have selected the BRUSH PRIMITIVES option under Project Settings… then Texture lock will always be on.

Load from List…(Menu: Textures->Load from 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.

Flush
The flush command frees up texture memory and should improve editor performance. Exactly how much is flushed depends on your choice of commands.

Texture Window Scale(Menu->Textures->Texture Window Scale->)
This affects the size of the texture images displayed in the Textures window. Clicking on the menu entry opens up a pop-up window with the following size selections: 200%, 100%, 50%, 25%, and 10%. Adjust it to suit your liking. If seeing the detail in the textures is important to you, set the size to 100% or larger. If you know your way around the textures without having to see each pixel, set it for smaller.

Texture Directories(Menu: Textures)
This is not a command. The entries on the Textures Menu below "Texture Window Scale" 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 Shift Down (SHIFT+DOWN ARROW)
Texture Shift Up (SHIFT+UP ARROW)
Texture Shift Left (SHIFT+LEFT ARROW)
Texture Shift Right (SHIFT+RIGHT ARROW)

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 Rotate Clockwise (SHIFT+PAGEDOWN)
Texture Rotate Counter-Clockwise (SHIFT+PAGEUP)

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.

Texture Scale Down (CTRL+DOWN ARROW)
Texture Scale Up (CTRL+UP ARROW)
Texture Scale Left (CTRL+LEFT ARROW)
Texture Scale Right (CTRL+RIGHT ARROW)

 

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.
NOTE: These textures should have been installed with the installation of Anachroradiant. Some of these textures are not supported by Anachronox, but have still been included until I can rule them out.

Areaportal
Color: Opaque Red Orange
Location: (textures/e1u1/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. See AnachroRadiant/Working with Textures/Content Flags and AnachroRadiant/Entity Descriptions.

Caulk
Location: (textures/e1u1/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. Every face that will not be viewable by the player and does not have some other texture or content/surface flag should have this. Please note that caulk was not used in Anachronox maps.

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/e1u1/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 "e1u1/clip." Clip is a nondrawing texture that blocks player movement.

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.

Hint
Location: (textures/e1u1/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.

Origin
Location: (textures/e1u1/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/e1u1/skip)
Color: Transparent yellow
Game Function: This texture is used in maps to discard sides of hint brushes.

Slick
Location: (textures/e1u1/slick)
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/e1u1/trigger)
Color: Transparent Dark Yellow
Game Function: Used to make trigger brushes.