Difference between revisions of "Refract"

From Valve Developer Community
Jump to: navigation, search
m
(added note about water based stuff.)
Line 30: Line 30:
 
; <code>$vertexcolormodulate</code>
 
; <code>$vertexcolormodulate</code>
 
: {{todo|See [[$vertexcolor]].}}
 
: {{todo|See [[$vertexcolor]].}}
 +
 +
== Caveats ==
 +
 +
* Currently it is not possible to define an overall alpha mask to indicate where to fall-off refract. This however only applies to the brush based and model geometry, and not particles. To get alpha on brush or model based geometry you can create a normalmap with an alpha channel, and define that as the first $normalmap. Using another normal of your choice you can then define a normalmap for $normalmap2. $normalmap2 will inherit the alpha of the first normalmap, and will act accordingly. This is extremely useful for faking effects like scrolling water of a surface. Where the first normalmap can provide the alpha, and the second normalmap can move along that alpha.
  
 
== See also ==
 
== See also ==

Revision as of 22:52, 14 July 2011

Deutsch Français
A refracting func_brush.

The Refract shaders distorts objects behind it. It is similar to Water, but does not reflect and so is not restricted to flat surfaces. Can be used to create distorting glass windows etc.

Note:Will not work when applied to world brushes (including func_detail).

Syntax

Refract
{
	$normalmap ...
	$dudvmap ...
	$refracttint "[1 1 1]"
	$refractamount .2
}
$normalmap <string>
$dudvmap <string>
The pattern of refraction is defined by a bump map (DX9+) or DUDV map (DX8-). May be animated.
$refracttint <color>
$refracttinttexture <string>
Tints the colour of the refraction either uniformly or per-texel.
$refractamount <float>
$bluramount <float>
Strength of the effect. Use low values.
$forcerefract
Confirm:Override for users running with low detail settings?
$vertexcolormodulate
To do: See $vertexcolor.

Caveats

  • Currently it is not possible to define an overall alpha mask to indicate where to fall-off refract. This however only applies to the brush based and model geometry, and not particles. To get alpha on brush or model based geometry you can create a normalmap with an alpha channel, and define that as the first $normalmap. Using another normal of your choice you can then define a normalmap for $normalmap2. $normalmap2 will inherit the alpha of the first normalmap, and will act accordingly. This is extremely useful for faking effects like scrolling water of a surface. Where the first normalmap can provide the alpha, and the second normalmap can move along that alpha.

See also