Flowing water: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
m (SirYodaJedi moved page Flowing Water to Flowing water)
 
(28 intermediate revisions by 19 users not shown)
Line 1: Line 1:
[[Category:Level Design]]
{{screenshot}}
=Flowing Water=
 
#Use [[GCFScape]] to extract "root\cstrike\materials\models\props\CS_militia\river01.vtf" from "counter-strike source shared.gcf"
----
#Create a .[[VMT]] file called "flow" and paste the following inside it:
'''This method has been obsoleted by <code>[[Water_(shader)#Flowing_water|$scroll1 and $flowmap.]]</code>'''
----
 
[[File:Moving_water.jpg|thumb|300px|Flowing water in cs_militia.]]
#Use [[GCFScape]] to extract "root\cstrike\materials\models\props\CS_militia\river01.vtf" from "cstrike_pak_dir.vpk"
#Place this file in your "<game>/[[materials]]/flow" directory and then restart [[Hammer]] and/or the [[Source SDK]].
#Create a .[[VMT]] file called "flow" in the same directory and paste the following inside it:
<pre>
<pre>
UnLitGeneric
"LightmappedGeneric"
{
{
"$basetexture" "river01"
"$basetexture" "flow/river01"
"$translucent" "1"
"$translucent" 1
"$nocull" "1"
"$nocull" 1
     "$decal" 1
     "$decal" 1
 
 
 
 
 


"Proxies"
"Proxies"
{
{
"TextureScroll"
"TextureScroll"
{
{
"texturescrollvar" "$baseTextureTransform"
"texturescrollvar" "$baseTextureTransform"
"texturescrollrate" .15
"texturescrollrate" .15
"texturescrollangle" 270.00
"texturescrollangle" 270.00
}
}
}
}
}
}
</pre>
</pre>
#Place both of these files in your "<game>/[[materials]]" directory and then restart [[Hammer]] and/or the [[SourceSDK]].
 
#Create your [[water]] [[geometry]] and give it a nice water [[texture]].
 
#[[Copy]] all of your water geometry and place this copy one [[unit]] above and away from the original geometry.
== Straight ==
 
#Create your [[water]] [[geometry]] and give it a nice water [[material]].
#Copy all of your water geometry and place this copy one unit above and away from the original geometry.
#Texture the surface of this new geometry in the new "flow" material.
#Texture the surface of this new geometry in the new "flow" material.
#Adjust the [[scale]] and [[shift]] to conform with the edges of the water.
#Adjust the scale and shift to conform with the edges of the water.
#Compile.
 
 
== Corners & turns ==
 
#Create your [[water]] [[geometry]] and give it a nice water [[material]].
#Copy all of your water geometry and place this copy one unit above and away from the original geometry.
#Cut this copy into shapes of the correct dimensions for sewing ( 64 x 128 x 256 512 x 1024 x 2048 x etc depending how wide your river is go to the nearest value).
#Texture the surface of this new geometry in the new "flow" material (we will call this textured face "face x").
#Using the "Texture Application Box" make the top "face x" a displacement (the higher the power, the more power you have to pinpoint turns).
#Use "Paint Geometry" with the axis set to either X or Y axis and move the edges of the water flow to match up with the original waters boarder/containment.
#Make use of the "sew" tool to keep all the flowing-water displacements connected. Make sure when you are finished the geometry of the water-flow, to align the texture on each of the cuts so it flows correctly and consistent with the flowing animation.
#Compile.
#Compile.


=Troubleshooting and Notes=


*To distribute a map using this method you must include the "river01.[[vtf]]" and "flow.[[vmt]]" files in the [[BSP]] using a program such as [[BSPzip]].
== Troubleshooting and notes ==
*If the water appears to be flowing the wrong way, or upstream, set the texture's [[rotation]] to 180.
*For extra realism [[particle]], splash and [[sound]] effects will be required.


==See Also==
*To distribute a map using this method you should include the "river01.[[VTF|vtf]]" and "flow.[[VMT|vmt]]" files in the [[BSP]] using a program such as [[Using Bspzip to Embed Custom Content|Bspzip]], or distribute a .[[RES]] file with the map (zipping is more reliable).
*If the water appears to be flowing upstream (i.e. in the wrong direction), set the texture's [[Hammer Face Edit Dialog|rotation]] to 180.
*For extra realism [[Env smokestack|particle]], [[Env splash|splash]] and [[sound]] effects will be required. The [[env_embers]] entity can be used to simulate a splash effect.
 
 
== See also ==
 
*[[Water]]
*[[Alpha channel]]
*[[Alpha channel]]
*[[Creating a Material Tutorial]]
*[[Creating a Material]]
*[[Creating Decals]]
*[[Creating Decals]]
*[[Creating Materials]]
*[[Half-Life 2 Shader Fallbacks]]
*[[Half-Life 2 Shader Fallbacks]]
*[[Shader Types and Parameters]]
*[[Shader Types and Parameters]]
*[[Water]]


==External Links==
== External links ==
*Creating [http://sdknuts.net/tutorials/wiseMaterialScroll.asp Scrolling materials]
*[http://forum.interlopers.net/viewtopic.php?t=1799 Interlopers.net Waterfalls Tutorial] - A similar method for creating flowing water.
*[http://forum.interlopers.net/viewtopic.php?t=1799 Interlopers.net Waterfalls Tutorial] - A similar method for creating flowing water.
[[Category:Level_Design]]

Latest revision as of 12:08, 16 September 2024

Nuvola apps ksnapshot.png
This article or section needs a screenshot to help visually convey the subject.
You can upload screenshots at Special:Upload. For help, see Help:Images.

This method has been obsoleted by $scroll1 and $flowmap.


Flowing water in cs_militia.
  1. Use GCFScape to extract "root\cstrike\materials\models\props\CS_militia\river01.vtf" from "cstrike_pak_dir.vpk"
  2. Place this file in your "<game>/materials/flow" directory and then restart Hammer and/or the Source SDK.
  3. Create a .VMT file called "flow" in the same directory and paste the following inside it:
"LightmappedGeneric"
{
	"$basetexture"	"flow/river01"
	"$translucent"	1
	"$nocull"	1
    	"$decal"	1

	"Proxies"
	{
		"TextureScroll"
		{
			"texturescrollvar" "$baseTextureTransform"
			"texturescrollrate" .15
			"texturescrollangle" 270.00
		}
	}
}


Straight

  1. Create your water geometry and give it a nice water material.
  2. Copy all of your water geometry and place this copy one unit above and away from the original geometry.
  3. Texture the surface of this new geometry in the new "flow" material.
  4. Adjust the scale and shift to conform with the edges of the water.
  5. Compile.


Corners & turns

  1. Create your water geometry and give it a nice water material.
  2. Copy all of your water geometry and place this copy one unit above and away from the original geometry.
  3. Cut this copy into shapes of the correct dimensions for sewing ( 64 x 128 x 256 512 x 1024 x 2048 x etc depending how wide your river is go to the nearest value).
  4. Texture the surface of this new geometry in the new "flow" material (we will call this textured face "face x").
  5. Using the "Texture Application Box" make the top "face x" a displacement (the higher the power, the more power you have to pinpoint turns).
  6. Use "Paint Geometry" with the axis set to either X or Y axis and move the edges of the water flow to match up with the original waters boarder/containment.
  7. Make use of the "sew" tool to keep all the flowing-water displacements connected. Make sure when you are finished the geometry of the water-flow, to align the texture on each of the cuts so it flows correctly and consistent with the flowing animation.
  8. Compile.


Troubleshooting and notes

  • To distribute a map using this method you should include the "river01.vtf" and "flow.vmt" files in the BSP using a program such as Bspzip, or distribute a .RES file with the map (zipping is more reliable).
  • If the water appears to be flowing upstream (i.e. in the wrong direction), set the texture's rotation to 180.
  • For extra realism particle, splash and sound effects will be required. The env_embers entity can be used to simulate a splash effect.


See also

External links