Refract: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(cleanup, new params)
Line 1: Line 1:
[[Image:refract.jpg|thumb|A refracting [[func_brush]].]]
{{otherlang2|fr=Refract:fr}}


The '''<code>Refract</code>''' shaders distorts objects behind it. It is similar to <code>[[Water (shader)|Water]]</code>, but does not reflect.
[[File:Refract.jpg|thumb|A refracting [[func_brush]].]]


{{note|The shader may not work when applied to world geometry. Make any brushes you want it applied to are attached to entities (excluding [[func_detail]]).}}
The '''<code>Refract</code>''' shaders distorts objects behind it. It is similar to <code>[[Water (shader)|Water]]</code>, but does not reflect and so is not restricted to flat surfaces. Can be used to create distorting glass windows etc.


== Example ==
{{note|Will not work when applied to [[world brush]]es (including [[func_detail]]).}}
 
== Syntax ==


  '''Refract'''
  '''Refract'''
  {
  {
  [[$normalmap]] ... // Defines the refraction pattern; may be animated
  $normalmap ...
  [[$dudvmap]] ... // As above when running below [[DirectX Versions|DX9]]
  $dudvmap ...
  [[$refracttint]] "[1 1 1]" // Colors the refraction
  $refracttint "[1 1 1]"
  [[$refractamount]] 0.2 // Refraction strength; use low values
  $refractamount .2
  }
  }


{{tip|<code>[[$refracttint]]</code> values greater than one can make it brighten instead of darken.}}
; <code>[[$normalmap]] <[[string]]></code>
 
; <code>[[$dudvmap]] <string></code>
{{tip|<code>[[$bluramount]]</code> 1.0 // Defines how much the refraction should blur.}}
: The pattern of refraction is defined by a bump map (DX9+) or DUDV map (DX8-). May be animated.
 
; <code>$refracttint <[[color]]></code>
{{tip|<code>[[$refracttinttexture]]</code> ... // Defines a texture map for tinting the refraction.}}
; <code>$refracttinttexture <string></code>
: Tints the colour of the refraction either uniformly or per-texel.
; <code>$refractamount <[[float]]></code>
; <code>$bluramount <float></code>
: Strength of the effect. Use low values.
; <code>$forcerefract</code>
: {{confirm|Override for users running with low detail settings?}}
; <code>$vertexcolormodulate</code>
: {{todo|See [[$vertexcolor]].}}


== See also ==
== See also ==


*<code>[[Water (shader)|Water]]</code>
* <code>[[Water (shader)|Water]]</code>
 
{{otherlang:en}}
{{otherlang:en:fr|Refract:fr}}


[[Category:List of Shaders]]
[[Category:List of Shaders]]

Revision as of 07:58, 15 November 2009

Template:Otherlang2

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.pngNote: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
Todo: See $vertexcolor.

See also