Applying Textures: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (minoro)
No edit summary
Line 1: Line 1:
__NOTOC__{{first room menu}}
__NOTOC__{{first room menu}}
[[Image:hammer_texturebrowser1.jpg|thumb|left|200px|Click the '''Browse...''' button to open the Texture Browser.]]
[[Image:hammer_texturebrowser1.jpg|thumb|left|200px|Click the '''Browse...''' button to open the Texture Browser.]]
Now, we’ll change the brick walls of our room into something more appropriate.


* Click the '''Browse...''' button in the '''Texture Bar''' on the right side of the Hammer window.
In this section we will select textures for the walls, floor, and ceiling.


This will open the '''Texture Browser''' so we can find the texture we want.{{clr}}
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.
<br style="clear:both">


[[Image:hammer_texturebrowser2.jpg|thumb|right|200px|The Texture Browser. You can change the size of the texture preview to see more textures at once.]]


== The Texture Browser ==
==[[Hammer_Texture_Browser|The Texture Browser]]==
The '''Texture Browser''' lets you view and select textures to apply to brushes in your map.
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.


Currently you might see only a few large textures, which makes things a bit tedious to browse, so we’ll need to change that.
'''[[Hammer_Texture_Browser#Filter|Filtering Textures]]'''


[[Image:texture_size.jpg|frame|caption|left|Size controls for 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.


* In the lower left corner of the '''Texture Browser''' window there is a drop-down list bar called '''Size:'''. If it doesn’t say '''128x128''' already, pick that option.
'''Dev Textures'''


This will reduce the size of the texture samples, so that we can see more at once.{{clr}}
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".


<!--[[Image:hammer_texturebrowser3.jpg |thumb|right|400px| Double-click a texture to select it.]]-->
# Type <code>dev wall</code> into the filter.
* Find the texture labeled <code>brick/brickwall017b</code>. In order to make locating textures a little easier, you can type part of the desired texture name into the "Filter:" field at the bottom of the texture selection window. In this example, typing "017b" will display only the textures with "017b" in their name (only four in our case.) Double-click the desired texture, which will choose the texture for use and automatically close the browser window.
# Double-click the texture '''dev/dev_measurewall01a'''.


The most recently selected texture is shown in the '''Texture Bar'''.{{clr}}
The active texture displays under '''Current Texture''' on the right side of the Hammer interface.


[[Image:hammer_applycurrenttexture1.jpg|thumb|right|200px|Use the '''Apply Current Texture''' icon to put textures on brushes.]]
== Applying Textures ==
[[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 '''[[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.


== Applying the texture ==
Now we'll apply the brick texture to one of the walls.


* Left-click one of the wall brushes inside the room to select it. It's easier to select a brush in the 3D view.
'''[[Hammer_Map_Tools_Toolbar#Toggle_Texture_Application|Toggle Texture Application]]'''


{{note|If you select one of the walls and it selects the whole room, then you have to '''Ungroup''' the brushes. To ungroup, select the room in any view, then go to '''Tools > Ungroup'''. Now, when you go back to the 3D view you can select individual walls.}}
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.
[[Image:Hammer_faceeditdialog.png|250px|left|thumb|[[Hammer_Face_Edit_Dialog|Face Edit Sheet]]]]


* To apply the texture onto the wall, click the '''Apply Current Texture''' icon from the left panel (see image).
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.
*'''[[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 treated spacially. World alignment forces the texture to be stay in place as the object it is applied to moves. Face alignment uses the coordinates of the face as a basis for alignment.
*'''[[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.


<!--[[Image:hammer_selectwall2.jpg|thumb|right|200px|Click in the 3D View to select the next wall piece.]]-->
Using the same process apply a dev texture to the ceiling and the floor.
 
Depending on how tall your walls are, the texture might look, well, ugly. Luckily, you can adjust the way the texture is "painted" onto the face! Press Shift+A, or click "Toggle texture application" in the left toolbar, just above the "Apply current texture" button. Using this editor can be a little tricky, but with some practice it will begin to make sense. Try playing with a few of the options.
 
* Clicking "L", "R", or any of the options under "Justify" will automatically align the texture to the top, bottom, right, left, or center of the currently-selected face.
* Adjusting the "Texture scale" in the upper left of this window changes the way a texture tiles on the face. For instance, if a texture is 512 units high, and your wall is only 256 units tall, you could adjust the Y texture scale to 0.50 and the texture would fit appropriately on the wall.
* You can also arbitrarily rotate and shift the texture around on the face - this is useful for applying textures to objects such as doors, control panels, lights, and other things that require precise placement. You can also push f5 to apply textures, if they don't show up.
 
The rest of the walls also need to be textured, so we'll do those next.
 
* Rotate the camera in the 3D view with the methods you [[View Navigation|learned earlier]], so that it faces another wall brush that hasn’t been textured yet.
 
* Select it and apply the current texture to it in the same manner: Left-click another wall in one of the views to select it, and then press '''Apply Current Texture''' to apply the texture to the brush.
 
* Continue applying this texture to the other two walls, so that all the four walls look the same.{{clr}}
 
[[Image:hammer_texturebrowser5.jpg |thumb|right|400px|Type text in the '''filter''' field to only show materials with that text in their name.]]
 
== Texturing the ceiling ==
 
Finally we will texture the ceiling so it looks more like a ceiling.
 
Click the '''Browse...''' button once again to bring up the '''Texture Browser'''.
 
If you look at the scroll bar to the right, you can see that there are a lot of textures to browse through to find just ''one'' ceiling texture, but don't worry -- most ceiling textures are called "ceiling," and the filtering capability described above can be used in this situation as well.
 
* Type in "ceiling" in the '''Filter''', as shown in the image. This will reduce the browser list to only textures with names containing the word "ceiling".
<!--[[Image:hammer_texturebrowser6.jpg|thumb|left|400px| -Double-click the ceiling texture to select it.]]-->
 
* Pick a texture from the list by double-clicking it. The texture named <code>concrete/concreteceiling002a</code> makes a good choice. The texture will be selected and the browser will close.
<!--[[Image:hammer_applycurrenttexture2.jpg|thumb|right|200px|Select the ceiling brush with the Selection Tool, then use the '''Apply Current Texture''' icon to put textures on the ceiling.]]-->
 
* Finally, click the ceiling brush in the '''3D View''' to select it, click the '''Apply Current Texture''' icon to assign the texture to the ceiling, and you're done.{{clr}}
 
If you change your mind, you can simply bring up the Texture Browser again, choose a new texture, and reapply it to a brush.


{{tip|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.}}
{{tip|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.}}

Revision as of 15:26, 2 April 2008

Click the Browse... button to open the Texture Browser.

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

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


The Texture Browser

Use the Texture Browser to view and select textures you wish to apply to brushes in your map.

Texture preview size.
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.

Filtering Textures

The Texture Browser hosts thousands of textures, and navigating to the exact texture you wish to use could be problematic, if not for the Filter feature. This feature allows you to specify part of a file name, such as "concrete wall", "plaster ceiling", or "metal door". The Texture Browser then filters for only those textures that contain that text.

Dev Textures

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".

  1. Type dev wall into the filter.
  2. Double-click the texture dev/dev_measurewall01a.

The active texture displays under Current Texture on the right side of the Hammer interface.

Applying Textures

Use the Apply Current Texture icon to apply textures to brushes.
  1. Activate the Selection Tool Hammer select.png.
  2. Highlight the wall you wish to texture by clicking on it in the Camera view.
    Note.pngNote:If you select one of the walls and it selects the whole room, then you must Ungroup the brushes. To ungroup, select the room in any view, then go to Tools > Ungroup. Then select individual walls.
  3. Click the Apply Current Texture icon File:Hammer applycurrenttextureicon.jpg from the left panel to apply the active texture to the selected brush.


Toggle Texture Application

Depending on the texture and the surface, your texture may not fit perfectly on your wall. Using the Toggle Texture Application tool File:Hammer toggletextureapplicationicon.jpg, you can adjust your texture to fit the wall appropriately. The Toggle Texture Application tool opens the Face Edit Sheet for the selected surface.

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.

  • 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.
  • 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.
  • Rotation rotates the texture on a brush face.
  • 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.
  • Align specifies how the texture is treated spacially. World alignment forces the texture to be stay in place as the object it is applied to moves. Face alignment uses the coordinates of the face as a basis for alignment.
  • 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.

Using the same process apply a dev texture to the ceiling and the floor.

Tip.pngTip: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.

Template:Otherlang:en Template:Otherlang:en:fr