Applying Textures: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(cleanup)
Line 4: Line 4:
| zh-cn = Applying Textures:zh-cn
| zh-cn = Applying Textures:zh-cn
}} {{first room menu}}
}} {{first room menu}}
[[Image:hammer_texturebrowser1.jpg|thumb|left|200px|Click the '''Browse...''' button to open the Texture Browser.]]


In this section we will select textures for the walls, floor, and ceiling.
In this section we will select textures for the walls, floor, and ceiling.


To open the '''[[Hammer_Texture_Browser|Texture Browser]]''', click the '''<code>Browse...</code>''' button in the Texture group on the right side of the Hammer interface.
== The Texture Browser ==
<br style="clear:both">


The '''[[Hammer_Texture_Browser|Texture Browser]]''' is used to view and select textures (or more accurately [[materials]]) that you want to apply to [[brush]]es in your map. The active texture is displayed in a box on the right side of the Hammer interface.


==[[Hammer_Texture_Browser|The Texture Browser]]==
To open the texture browser, click the '''Browse...''' button in the Texture group on the right side of the Hammer interface:
Use the '''[[Hammer_Texture_Browser|Texture Browser]]''' to view and select textures you wish to apply to brushes in your map.
[[Image:hammer_texturebrowserSize.png|frame|caption|left|Texture preview size.]][[Image:hammer_texturebrowser2.jpg|thumb|right|200px|'''[[Hammer_Texture_Browser|Texture Browser]]''' Change the size of the texture preview to see more textures at once.]] To ease the browsing of textures, you may wish to adjust the textures' preview size.
In the lower left corner of the '''Texture Browser''' window, select '''128x128''' from the '''Size:''' drop-down menu.
This will reduce the size of the texture samples, so that we can see more at once.


'''[[Hammer_Texture_Browser#Filter|Filtering Textures]]'''
[[Image:hammer_texturebrowser1.jpg|thumb|none|Click the '''Browse...''' button to open the Texture Browser.]]


The [[Hammer_Texture_Browser|Texture Browser]] hosts thousands of textures, and navigating to the exact texture you wish to use could be problematic, if not for the [[Hammer_Texture_Browser#Filter|Filter]] feature.  This feature allows you to specify part of a file name, such as "concrete wall", "plaster ceiling", or "metal door". The [[Hammer_Texture_Browser|Texture Browser]] then filters for only those textures that contain that text.  
; Thumbnail size
: To ease the browsing of textures, you may wish to adjust the textures' preview size: in the lower left corner of the texture browser window, select "128x128" from the "Size" drop-down menu. This will reduce the size of the texture samples, so that we can see more at once.
: [[File:Hammer texturebrowserSize.png|frame|none|Changing thumbnail size]]
; Filtering the gallery
: In most games the texture browser hosts thousands of items. Navigating to the exact texture you want to use would be problematic were it not for [[Hammer Texture Browser#Filter|filtering]].  This feature allows you to search for parts of file names. You can use spaces to split your filter in multiple terms, such as "concrete wall", "plaster ceiling", or "metal door" (don't include the quote marks).
: To show the entire list of textures again, open the Texture Browser, select the text in the filter field and press {{key|Backspace}} or {{key|Delete}} to delete it.
; Dev Textures
: Source comes with a number of textures specifically designed to help you create brushes in proportion to the player. They are called "dev textures", for "development", and can be found by filtering for "dev".
: {{todo|Picture of dev textures in use.}}


'''Dev Textures'''
Find and double-click <code>dev/dev_measurewall01a</code>.


When building a map, it is good practice to start with textures that help create appropriately-sized objects.  Hammer includes a number of textures specifically to assist you in creating maps in proportion to the player called "dev textures".
== Applying textures ==


# Type <code>dev wall</code> into the filter.
With a texture selected, it now has to be a applied to a brush.
# Double-click the texture '''dev/dev_measurewall01a'''.


The active texture displays under '''Current Texture''' on the right side of the Hammer interface.
# Activate the {{hammer select}}.
# Highlight the wall you wish to texture by clicking on it in the Camera view. If you select one of the walls and it selects the whole room, either change the upper-right "Select" setting from "Groups" to "Objects", or [[Hammer Tools Menu#Group and Ungroup .3CCtrl.2BG.3E and .3CCtrl.2BU.3E|Ungroup]] the brushes.
# Click the '''[[Hammer Map Tools Toolbar#Apply Current Texture|Apply Current Texture]]''' button [[Image:Hammer_applycurrenttextureicon.jpg|28px]] from the left panel to apply the active texture to the selected brush.


== Applying Textures ==
[[File:Hammer appliedTextureExample.png|thumb|none|<code>dev_measurewall01a</code> in action.]]
[[Image:hammer_appliedTextureExample.png|thumb|right|200px|Use the '''[[Hammer_Map_Tools_Toolbar#Apply_Current_Texture|Apply Current Texture]]''' icon to apply textures to brushes.]]
# Activate the [[Hammer Selection Tool|Selection Tool]] [[Image:hammer_select.png|28px]].
# Highlight the wall you wish to texture by clicking on it in the Camera view. {{note|If you select one of the walls and it selects the whole room, then you must either change the upper-right "Select:" from "Groups" to "Objects", or '''[[Hammer_Tools_Menu#Group_and_Ungroup_.3CCtrl.2BG.3E_and_.3CCtrl.2BU.3E|Ungroup]]''' the brushes. To ungroup, select the room in any view, then go to '''Tools > Ungroup'''. Then select individual walls.}}
# Click the '''[[Hammer_Map_Tools_Toolbar#Apply_Current_Texture|Apply Current Texture]]''' icon [[Image:Hammer_applycurrenttextureicon.jpg|28px]] from the left panel to apply the active texture to the selected brush.


== Adjusting textures ==


'''[[Hammer_Map_Tools_Toolbar#Toggle_Texture_Application|Toggle Texture Application]]'''
A newly-applied texture may not fit properly on a brush. Using the [[Hammer Map Tools Toolbar#Toggle Texture Application|Toggle Texture Application]] tool [[File:Hammer toggletextureapplicationicon.jpg|28px]], you can adjust it so that it does.


Depending on the texture and the surface, your texture may not fit perfectly on your wall. Using the [[Hammer_Map_Tools_Toolbar#Toggle_Texture_Application|Toggle Texture Application]] tool [[Image:Hammer_toggletextureapplicationicon.jpg|28px]], you can adjust your texture to fit the wall appropriately.  The Toggle Texture Application tool opens the [[Hammer_Face_Edit_Dialog|Face Edit Sheet]] for the selected surface.
Because our wall is 1024x512, any texture will fit it evenly because the dimensions of the wall and the textures are all powers of two. However, we can still see some changes by altering the settings in the Face Edit Sheet that has appeared:
[[Image:Hammer_faceeditdialog.png|250px|left|thumb|[[Hammer_Face_Edit_Dialog|Face Edit Sheet]]]]


Because we are using a dev texture that is 128 units and we are applying it to a wall that is 1024 x 512 (both multiples of 128), the texture should already fit the wall perfectly, but we can still see some changes by altering the settings in the Face Edit Sheet.
[[File:Hammer faceeditdialog.png|250px|right|The Face Edit Sheet]]
*'''[[Hammer_Face_Edit_Dialog#Texture_Scale_.28X.2FY.29|Texture Scale]]''' adjusts the size of the texture.  Numbers smaller than 1 make the texture smaller.  Numbers greater than 1 make the texture larger.  Negative numbers mirror the texture.
*'''[[Hammer_Face_Edit_Dialog#Texture_Shift_.28X.2FY.29|Texture Shift]]''' moves the texture along the X or Y axis. Positive numbers move the texture left (X axis) and down (Y axis).  Negative numbers move the texture right (X axis) and up (Y axis).
*'''[[Hammer_Face_Edit_Dialog#Current_Texture|Current Texture]]''' changes the applied texture on the surface.
*'''[[Hammer_Face_Edit_Dialog#Lightmap_Scale|Lightmap scale]]''' affects how light effects apply to the surface.  Smaller numbers are higher resolution and produce more expensive lighting effects.  Larger numbers are lower resolution and produce cheaper lighting effects.
*'''[[Hammer_Face_Edit_Dialog#Rotation|Rotation]]''' rotates the texture on a brush face.
*'''[[Hammer_Face_Edit_Dialog#Justify|Justify]]''' specifies how the texture lines up to an edge. '''L''' for left, '''R''' for right, '''T''' for top, '''B''' for bottom, '''C''' for center, and '''Fit''' scales the X & Y values to fit the entire texture onto the surface.
*'''[[Hammer_Face_Edit_Dialog#Align:_World_and_Face|Align]]''' specifies how the texture is projected onto the face. [[Texture_alignment#World_Alignment|World alignment]] applies textures along the global x, y, or z axis. [[Texture_alignment#Face_Alignment|Face alignment]] applies the texture directly onto the face no matter which way it faces.
*'''[[Hammer_Face_Edit_Dialog#Mode|Mode]]''' allows you to select what will happen when you click on a brush face with the left mouse button.
<br style="clear:both">
Apply the same texture to the remaining three walls.


Using the same process apply a dev texture to the ceiling and the floor.
; Texture Scale
: Adjusts the size of the texture. A value of '1' maps one texture pixel onto one [[unit]]. Negative numbers mirror the texture.
; Texture Shift
: Moves the texture along the X or Y axis. Positive numbers move the texture left (X axis) and down (Y axis). Negative numbers move the texture right (X axis) and up (Y axis).
; Current Texture
: Changes the applied texture on the surface.
; Lightmap Scale
: Affects how light effects apply to the surface. Smaller numbers are higher resolution and produce more expensive lighting effects. Larger numbers are lower resolution and produce cheaper lighting effects. See also [[Lightmap]].
; Rotation
: Rotates the texture on the brush face.
; Justify
: Snaps the texture's position to a specified position on the wall. '''L'''eft, '''R'''ight, '''T'''op, '''B'''ottom and '''C'''enter. Finally, '''Fit''' squashes the entire texture onto the surface.
; Align
: Specifies how the texture is projected onto the face. [[Texture alignment#World Alignment|World alignment]] applies textures along the global x, y, or z axis. [[Texture alignment#Face Alignment|Face alignment]] applies the texture directly onto the face no matter which way it faces.
; Mode
: Allows you to select what will happen when you click on a brush face with the left mouse button.


{{tip|To show the entire list of textures again, open the Texture Browser, select the text in the '''filter''' field, and press {{key|Backspace}} or {{key|Delete}} to delete it.}}
Apply the same texture to the remaining three walls, and using the same process apply a dev texture to the ceiling and the floor.


{{Navbar|Creating a Room|Your First Map|Adding Point Entities}}
{{Navbar|Creating a Room|Your First Map|Adding Point Entities}}


[[Category:Level Design Tutorials]]
[[Category:Level Design Tutorials]]

Revision as of 05:57, 2 January 2010

Template:Otherlang2

In this section we will select textures for the walls, floor, and ceiling.

The Texture Browser

The Texture Browser is used to view and select textures (or more accurately materials) that you want to apply to brushes in your map. The active texture is displayed in a box on the right side of the Hammer interface.

To open the texture browser, click the Browse... button in the Texture group on the right side of the Hammer interface:

Click the Browse... button to open the Texture Browser.
Thumbnail size
To ease the browsing of textures, you may wish to adjust the textures' preview size: in the lower left corner of the texture browser window, select "128x128" from the "Size" drop-down menu. This will reduce the size of the texture samples, so that we can see more at once.
Changing thumbnail size
Filtering the gallery
In most games the texture browser hosts thousands of items. Navigating to the exact texture you want to use would be problematic were it not for filtering. This feature allows you to search for parts of file names. You can use spaces to split your filter in multiple terms, such as "concrete wall", "plaster ceiling", or "metal door" (don't include the quote marks).
To show the entire list of textures again, open the Texture Browser, select the text in the filter field and press ← Backspace or Delete to delete it.
Dev Textures
Source comes with a number of textures specifically designed to help you create brushes in proportion to the player. They are called "dev textures", for "development", and can be found by filtering for "dev".
Todo: Picture of dev textures in use.

Find and double-click dev/dev_measurewall01a.

Applying textures

With a texture selected, it now has to be a applied to a brush.

  1. Activate the Selection tool Hammer select.png.
  2. Highlight the wall you wish to texture by clicking on it in the Camera view. If you select one of the walls and it selects the whole room, either change the upper-right "Select" setting from "Groups" to "Objects", or Ungroup the brushes.
  3. Click the Apply Current Texture button File:Hammer applycurrenttextureicon.jpg from the left panel to apply the active texture to the selected brush.
dev_measurewall01a in action.

Adjusting textures

A newly-applied texture may not fit properly on a brush. Using the Toggle Texture Application tool File:Hammer toggletextureapplicationicon.jpg, you can adjust it so that it does.

Because our wall is 1024x512, any texture will fit it evenly because the dimensions of the wall and the textures are all powers of two. However, we can still see some changes by altering the settings in the Face Edit Sheet that has appeared:

The Face Edit Sheet
Texture Scale
Adjusts the size of the texture. A value of '1' maps one texture pixel onto one unit. Negative numbers mirror the texture.
Texture Shift
Moves the texture along the X or Y axis. Positive numbers move the texture left (X axis) and down (Y axis). Negative numbers move the texture right (X axis) and up (Y axis).
Current Texture
Changes the applied texture on the surface.
Lightmap Scale
Affects how light effects apply to the surface. Smaller numbers are higher resolution and produce more expensive lighting effects. Larger numbers are lower resolution and produce cheaper lighting effects. See also Lightmap.
Rotation
Rotates the texture on the brush face.
Justify
Snaps the texture's position to a specified position on the wall. Left, Right, Top, Bottom and Center. Finally, Fit squashes the entire texture onto the surface.
Align
Specifies how the texture is projected onto the face. World alignment applies textures along the global x, y, or z axis. Face alignment applies the texture directly onto the face no matter which way it faces.
Mode
Allows you to select what will happen when you click on a brush face with the left mouse button.

Apply the same texture to the remaining three walls, and using the same process apply a dev texture to the ceiling and the floor.