WiseWaters: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎See Also: typo fix)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:WiseWaters: HL2 Water crash course}}
{{DISPLAYTITLE:WiseWaters: HL2 Water crash course}}
{{SDKNuts Tutorials}}
{{wisemxport|[[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) 21:59, 16 June 2018 (UTC)}}
{{wisemxport|[[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) 21:59, 16 June 2018 (UTC)}}


Line 6: Line 7:
#If you’re creating water in any of the Source engine Multiplayer games do so sparingly. Keep track of in-game performance with the console command <code>[[+showbudget]]</code>.
#If you’re creating water in any of the Source engine Multiplayer games do so sparingly. Keep track of in-game performance with the console command <code>[[+showbudget]]</code>.
#Your water will work great within [[displacements]], like the canals of Half-Life 2, but be aware that [[leak#Special geometry does not seal the world|you must seal behind the displacements with normal world brushes]].
#Your water will work great within [[displacements]], like the canals of Half-Life 2, but be aware that [[leak#Special geometry does not seal the world|you must seal behind the displacements with normal world brushes]].
#One <code>[[water_lod_control]]</code> is required, it can be placed anywhere in the map, does not even need to be near the water and if you forget to add this control the compilers will add one for you.
#One {{ent|water_lod_control}} is required, it can be placed anywhere in the map, and does not even need to be near the water.
#One <code>[[env_cubemap]]</code> is required for each volume of water and it’s best to assign the face in the entity’s properties. When placing these just click on the water surface in the 3D viewport and it will be placed at the correct distance from the water.
##If you forget to add this, the compiler will add one for you.
#Make sure [[Hammer Map Menu#Snap to Grid <Shift+W>|'''Snap to Grid''']] is '''ON''' and reduce the size of your grid if it helps to place your water, This isn’t as important when water is placed within displacements as it should overlap the displacement but when water is within normal brushes you should be very accurate with placement, if you have to use more than one brush for your water in an odd shape make sure there are no gaps.
#One {{ent|env_cubemap}} is required for each volume of water and it’s best to assign the face in the entity’s properties. When placing these just click on the water surface in the 3D viewport and it will be placed at the correct distance from the water.
#If you want water that moves, use <code>[[func_water_analog]]</code>.
#Make sure [[Hammer Map Menu#Snap to Grid <Shift+W>|'''Snap to Grid''']] is '''ON''' and reduce the size of your grid if it helps to place your water.
##This isn’t as important when water is placed within [[displacements]] as it ''should'' overlap the displacement, but when water is within normal brushes you don't want it to overlap. You may have to use more than one brush for your water if it needs to fill an odd shape.
#If you want water that moves, use {{ent|func_water_analog}}.


==Creating the water==
==Creating the water==
[[File:Hammer texturebrowser1.png|thumbnail|right|[[Applying Textures|Click the Browse... button to open the Texture Browser.]]]]
[[File:Hammer texturebrowser1.png|thumbnail|right|[[Applying Textures|Click the Browse... button to open the Texture Browser.]]]]
#Use the Hammer Texture browser, on the right-hand toolbar, and select the nodraw texture (<code>tools/toolsnodraw</code>).
#Using the Hammer [[Hammer Texture Browser|texture browser]], select the nodraw texture (<code>tools/toolsnodraw</code>).
#With the [[Block Tool]] (Shift+B) create the brush that will become your water. You will now have a brush entirely textured with nodraw.
#With the [[Block Tool]] (Shift+B) create the brush that will become your water. You will now have a brush entirely textured with nodraw.
#Use the Toggle texture application tool (Shift+A), also known as the [[Face Edit Dialog]]), to browse for water textures. Use the filter word ''water''.
#Use the Toggle texture application tool (Shift+A), also known as the [[Face Edit Dialog]]), to browse for water textures. Use the filter word ''water''.
Line 22: Line 25:
#Your water is now complete. (Don’t forget to add that one <code>water_lod_control</code>.)
#Your water is now complete. (Don’t forget to add that one <code>water_lod_control</code>.)


{{note|When you compile your map and are ready to test your water in the game you first need to run the console command <code>[[buildcubemaps#HDR|buildcubemaps]]</code> once after each compile.}}
{{note|When you compile your map and are ready to test your water in the game you first need to run the console command <code>[[buildcubemaps#HDR|buildcubemaps]]</code> once after each compile.
{{tip|If you are using {{mapbase|4.1}}, run the game with <code>-autocubemap</code> to automatically build LDR and HDR cubemaps}}}}


==See Also==
==See also==
*[http://type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseWaters.zip Example VMF showing many water textures.] Note that due to how visibility and the water shader interact, some water textures will not render correctly when the player is not in the intended spot. Also, the 3D view in Hammer may appear glitchy, due to some textures being partially broken.
*[http://type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseWaters.zip Example VMF showing many water textures.] Note that due to how visibility and the water shader interact, some water textures will not render correctly when the player is not in the intended spot. Also, the 3D view in Hammer may appear glitchy, due to some textures being partially broken.
*[https://cdn.discordapp.com/attachments/434089157875466242/457788298274799629/wiseWaters.vmf Example VMF backup]
*[https://cdn.discordapp.com/attachments/434089157875466242/457788298274799629/wiseWaters.vmf Example VMF backup]

Latest revision as of 08:30, 15 August 2024


This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.

Seven important tips before we begin

  1. See the Adding Water page.
  2. If you’re creating water in any of the Source engine Multiplayer games do so sparingly. Keep track of in-game performance with the console command +showbudget.
  3. Your water will work great within displacements, like the canals of Half-Life 2, but be aware that you must seal behind the displacements with normal world brushes.
  4. One water_lod_control is required, it can be placed anywhere in the map, and does not even need to be near the water.
    1. If you forget to add this, the compiler will add one for you.
  5. One env_cubemap is required for each volume of water and it’s best to assign the face in the entity’s properties. When placing these just click on the water surface in the 3D viewport and it will be placed at the correct distance from the water.
  6. Make sure Snap to Grid is ON and reduce the size of your grid if it helps to place your water.
    1. This isn’t as important when water is placed within displacements as it should overlap the displacement, but when water is within normal brushes you don't want it to overlap. You may have to use more than one brush for your water if it needs to fill an odd shape.
  7. If you want water that moves, use func_water_analog.

Creating the water

  1. Using the Hammer texture browser, select the nodraw texture (tools/toolsnodraw).
  2. With the Block Tool (Shift+B) create the brush that will become your water. You will now have a brush entirely textured with nodraw.
  3. Use the Toggle texture application tool (Shift+A), also known as the Face Edit Dialog), to browse for water textures. Use the filter word water.
  4. Double-click on any image to select that texture, which will return you to the Face Edit dialog.
  5. Right-click on the surface of the water to apply this texture.
  6. With the Entity Tool (Shift+E) place an env_cubemap in the center above the water.
  7. Double-click on the env_cubemap or press Alt + Enter to bring up the properties. Choose Brush Faces then use the Pick... button and click on the water surface.
  8. Your water is now complete. (Don’t forget to add that one water_lod_control.)
Note.pngNote:When you compile your map and are ready to test your water in the game you first need to run the console command buildcubemaps once after each compile.
Tip.pngTip:If you are using Mapbase Mapbase, run the game with -autocubemap to automatically build LDR and HDR cubemaps

See also

  • Example VMF showing many water textures. Note that due to how visibility and the water shader interact, some water textures will not render correctly when the player is not in the intended spot. Also, the 3D view in Hammer may appear glitchy, due to some textures being partially broken.
  • Example VMF backup