Difference between revisions of "LightmappedReflective"
NvC DmN CH (talk | contribs) m (moved proxies todo in its bug) |
m |
||
Line 29: | Line 29: | ||
{{bug|Adding proxies to a lightmappedreflective causes the texture to not be drawn. (Could this be because it includes some default proxy in order for it to work, and once there is a user-defined proxy, those "behind the scenes" proxies are no longer there?)}} | {{bug|Adding proxies to a lightmappedreflective causes the texture to not be drawn. (Could this be because it includes some default proxy in order for it to work, and once there is a user-defined proxy, those "behind the scenes" proxies are no longer there?)}} | ||
− | {{bug|Does not appear to work in Portal 2}} | + | {{bug|Does not appear to work in Portal 2}} {{todo|Does it work in portal 1?}} |
== Shader parameters == | == Shader parameters == | ||
Line 63: | Line 63: | ||
{{MatParam|%tooltexture|texture|Defines the texture Hammer will display in the material browser.}} | {{MatParam|%tooltexture|texture|Defines the texture Hammer will display in the material browser.}} | ||
{{MatParam|$fresnelpower|float|Controls fresnel effect of reflections.}} | {{MatParam|$fresnelpower|float|Controls fresnel effect of reflections.}} | ||
− | {{MatParam|$translucent|boolean|No effect, but must be included or entity will not work properly.}} | + | {{MatParam|$translucent|boolean|No effect, but must be included or entity will not work properly. {{todo|double check. Does it work in other source engine versions?}}}} |
Revision as of 23:10, 8 January 2020
LightmappedReflective
is the shader used by func_reflective_glass. This shader renders real-time reflection and refractions similar to Water (shader).
Warning: All parameters listed in the example (except $bumpframe, %tooltexture and $surfaceprop) must be included when used, or func_reflective_glass may not work properly.
Example
The example shown here is materials/glass/reflectiveglass001.vmt
"lightmappedreflective" { "%tooltexture" "dev/flat_normal" "$refracttexture" "_rt_WaterRefraction" "$refractamount" "0" "$refracttint" "[.5 .5 .6]" "$reflecttexture" "_rt_WaterReflection" "$reflectamount" "0" "$reflecttint" "[1 1 1]" "$fresnelpower" "0" "$minreflectivity" "0.8" "$maxreflectivity" "1.0" "$normalmap" "dev/flat_normal" "$surfaceprop" "glass" "$bumpframe" "0" }


To do: Does it work in portal 1?
Shader parameters
Textures
$basetexture
<texture>
- Albedo texture, optional.
$normalmap
<texture>
- bump map, per-pixel warping of the reflection
$bumpframe
<integer>
- Frame to start the animated du/dv map and bump map on, respectively. Somewhat confusingly,
$bumpframe
affects$normalmap
, which should be pointing to a bump map. $bumptransform
<matrix>
- Transforms the bump map texture.
- The default position is
"center .5 .5 scale 1 1 rotate 0 translate 0 0"
.center
defines the point of rotation. Only useful ifrotate
is being used.scale
fits the texture into the material the given number of times. '2 1
' is a 50% scale in the X axis.rotate
rotates the texture counter-clockwise in degrees. Accepts any number, including negatives.translate
shifts the texture by the given numbers. '.5
' will shift it half-way.
Note: All values must be included!
Bug: Scaling the texture may cause odd issues where the Texture Lock tool in Hammer will not actually lock the texture in place.
Bug: Rotating textures applied on brushes will rotate around the map origin (confirm: Orangebox engine only?). A fix for this is to change the center position in the VMT to the brush's origin.
Reflection
$reflecttexture
<texture>
- Texture to use for reflection. For real-time reflections, use
_rt_WaterReflection
. $reflectamount
<float>
- Amount of warp for the reflection. Higher values produce more warping.
$reflecttint
<RGB matrix>
- Color tint for the real-time reflection.
$reflectance
<float>
- Controls opacity of reflection. Similar to $alpha
$envmapmask
<texture>
- Per-pixel opacity of reflection
$minreflectivity
<float>
- To do: What is this?
$maxreflectivity
<float>
- To do: What is this?
Refraction
$refracttexture
<texture>
- Texture to use for refraction. For real-time refractions, use
_rt_WaterRefraction
. $refractamount
<float>
- Amount of warp for the refraction. Higher values produce more warping.
$refracttint
<RGB matrix>
- Color of the refraction.
Warning: It is recommended that you set this to white or something close to white so that edge transitions work properly on DX9.
Other
$surfaceprop
<name>
- See $surfaceprop.
%tooltexture
<texture>
- Defines the texture Hammer will display in the material browser.
$fresnelpower
<float>
- Controls fresnel effect of reflections.
$translucent
<boolean>
- No effect, but must be included or entity will not work properly. To do: double check. Does it work in other source engine versions?