LightmappedReflective: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 65: Line 65:
{{MatParam|$fresnelpower|float|Controls fresnel effect of reflections.}}
{{MatParam|$fresnelpower|float|Controls fresnel effect of reflections.}}
{{MatParam|$translucent|boolean|Will make the surface both reflective and transparent dependent on the angle and distance of view.
{{MatParam|$translucent|boolean|Will make the surface both reflective and transparent dependent on the angle and distance of view.
: {{warning| MUST be set to "1" in Counter-Strike:Global Offensive in order to allow the surface reflect at all}}}}
: {{warning| MUST be set to "1" in Counter-Strike:Global Offensive in order to allow the surface to reflect at all}}}}

Revision as of 05:28, 11 July 2021

LightmappedReflective is the shader used by func_reflective_glass. This shader renders real-time reflection and refractions similar to Water (shader).

Warning.pngWarning: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"
}
Icon-Bug.pngBug: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?)  [todo tested in ?]
Icon-Bug.pngBug:Does not appear to work in Portal 2  [todo tested in ?]
Warning.pngWarning:Although this is functional in Portal 1, the reflection does not update when viewed through portals and portals will only update in the reflection if both of them are visible to you and to the func_reflective glass. Also, if the portals are rotated differently and viewed through the func_reflective_glass, the portals will display incorrectly.

Shader parameters

Textures

$basetexture [[$normalmap|$normalmap]] $bumpframe $bumptransform

Reflection

$reflecttexture $reflectamount $reflecttint $reflectance $envmapmask $minreflectivity $maxreflectivity

Refraction

$refracttexture $refractamount $refracttint

Other

$surfaceprop %tooltexture $fresnelpower $translucent