Making a wall of water: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(New page: thumb|Water with a shader"LightmappedGeneric". == Principe == In some cases, create a wall of water is a solution. However, the shader "water" can not do that, it i...)
 
m (Unicodifying, replaced: [[Image: → [[File: (2))
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Image:fake_eau.jpg|thumb|Water with a shader"LightmappedGeneric".]]
{{Underlinked|date=January 2024}}
== Principe ==
{{lang|Making a wall of water}}
[[File:fake_eau.jpg|thumb|Water with LightmappedGeneric.]]


In some cases, create a wall of water is a solution. However, the shader "water" can not do that, it is limited to a flat surface, not vertically. It uses current shader here: "LightmappedGeneric" with shader settings to "water" to remedy the problem.
Sometimes, a wall of water is a nice (or required) feature of a map. However, the [[Water (shader)|Water]] shader can not do that; it is limited to flat, horizontal surfaces. The [[LightmappedGeneric]] shader can be used to mimic most of the Water shader's features instead.


You can simulate the reflections with cubemaps, fog, only with the materials "bottom", but no refractions. Like the water shader you have to use 2 VMT. BUMP will be used the one supplied by Vavle and materials used by the "water".
You can simulate reflections with cubemaps and fog, with the material's "bottom". However, refractions are not possible. Like the Water shader you have to use two VMT files. The normal  $bumpmap will be used.


== VMT top ==
== VMT Top ==


For texture "$ basetexture", an image created in Photoshop with a cloud filter should make an alpha channel using the desired transparency. You can then export to a file. VTF used under Source with the right tools.
For $basetexture, an image created in Photoshop with a cloud filter should make an alpha channel using the desired transparency. You can then export to a Source VTF file with the right tools.
[[Image:surface.jpg|150px|left|"$basetexture" generated under Photoshop.]]
{{clr}}


[[File:surface.jpg|150px|A $basetexture created with Photoshop.]]


  "LightmappedGeneric"
  LightmappedGeneric
  {
  {
          "%compilewater" 1
%compilewater 1
          "$abovewater" 1
$abovewater 1
          "$surfaceprop" "water"
$surfaceprop water
          "$bottommaterial" "..."
$bottommaterial ...
          "$basetexture" "dev/water_moving/ / base texture that you made earlier
$basetexture dev/water_moving // base texture that you made earlier
          "$bumpmap" "dev/water_normal"      //bump map
$bumpmap dev/water_normal // bump map
          "$translucent" "1"               
$translucent 1
          "$envmap" "env_cubemap"
$envmap env_cubemap
          "$envmaptint" "[1 .9 .8]"
$envmaptint "[1 .9 .8]"
          "$envmapcontrast" "1"
$envmapcontrast 1
          "$fogenable" "1"               
$fogenable 1
          "$fogcolor" "[ 1 1 1 ]"    
$fogcolor "[1 1 1]"
          "$fogstart" 0                  
$fogstart 0
          "$fogend" 50              
$fogend 50
  "Proxies"
   
{
Proxies
    "AnimatedTexture"
{
          {
AnimatedTexture
                "animatedtexturevar" "$basetexture"
{
                "animatedtextureframenumvar" "$frame"
animatedtexturevar $basetexture
                "animatedtextureframerate" 21.00
animatedtextureframenumvar $frame
          }
animatedtextureframerate 21
    "AnimatedTexture"
}
          {
AnimatedTexture
                "animatedtexturevar" "$bumpmap"
{
                "animatedtextureframenumvar" "$bumpframe"
animatedtexturevar $bumpmap
                "animatedtextureframerate" 21.00
animatedtextureframenumvar $bumpframe
          }
animatedtextureframerate 21
}
}
}
  }
  }


You will notice here that the basic texture is animated when he is just an image. This is necessary for the BumpMap animated.
You will notice that the still-image $basetexture is set to be animated in the VMT. This is necessary to get $bumpmap animated too.


== VMT Bottom ==
== VMT Bottom ==


  "LightmappedGeneric"
  LightmappedGeneric
  {
  {
          "$basetexture" "..."
$basetexture ...
          "$translucent" "1"
$translucent 1
          "$fogenable" "1"               
$fogenable 1
          "$fogcolor" "[ 1 1 1 ]"    
$fogcolor "[1 1 1]"
          "$fogstart" 0                  
$fogstart 0
          "$fogend" 300              
$fogend 300
  }
  }


== References ==
[[Category:Material System]]
Was translated from the French page http://developer.valvesoftware.com/wiki/Making_a_wall_of_water:fr
 
[[Category:Material]]

Latest revision as of 00:18, 7 January 2024

Underlinked - Logo.png
This article needs more Wikipedia icon links to other articles to help Wikipedia icon integrate it into the encyclopedia. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024
English (en)Français (fr)Translate (Translate)
Water with LightmappedGeneric.

Sometimes, a wall of water is a nice (or required) feature of a map. However, the Water shader can not do that; it is limited to flat, horizontal surfaces. The LightmappedGeneric shader can be used to mimic most of the Water shader's features instead.

You can simulate reflections with cubemaps and fog, with the material's "bottom". However, refractions are not possible. Like the Water shader you have to use two VMT files. The normal $bumpmap will be used.

VMT Top

For $basetexture, an image created in Photoshop with a cloud filter should make an alpha channel using the desired transparency. You can then export to a Source VTF file with the right tools.

A $basetexture created with Photoshop.

LightmappedGeneric
{
	%compilewater 1
	$abovewater 1
	$surfaceprop water
	$bottommaterial ...
	$basetexture dev/water_moving	// base texture that you made earlier
	$bumpmap dev/water_normal	// bump map
	$translucent 1
	$envmap env_cubemap
	$envmaptint "[1 .9 .8]"
	$envmapcontrast 1
	$fogenable 1
	$fogcolor "[1 1 1]"
	$fogstart 0
	$fogend 50

	Proxies
	{
		AnimatedTexture
		{
			animatedtexturevar $basetexture
			animatedtextureframenumvar $frame
			animatedtextureframerate 21
		}
		AnimatedTexture
		{
			animatedtexturevar $bumpmap
			animatedtextureframenumvar $bumpframe
			animatedtextureframerate 21
		}
	}
}

You will notice that the still-image $basetexture is set to be animated in the VMT. This is necessary to get $bumpmap animated too.

VMT Bottom

LightmappedGeneric
{
	$basetexture ...
	$translucent 1
	$fogenable 1
	$fogcolor "[1 1 1]"
	$fogstart 0
	$fogend 300
}