This article's documentation is for anything that uses the Source engine. Click here for more information.

$rimlight: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Changed to use Shaderparam and Matparam templates)
No edit summary
 
(17 intermediate revisions by 12 users not shown)
Line 1: Line 1:
[[Image:Heavy_rim.jpg|thumb|200px|Example of rim lighting in use on the TF2 Heavy.]]
{{LanguageBar}}


{{Shaderparam|$rimlight|since=Source 2007|shader1=VertexLitGeneric}} It adds a constant rim light to the model that appears to come indirectly from the environment. The color of the rim light is directly influenced by [[ambient light]].
[[File:Heavy_rim.jpg|thumb|200px|Example of rim lighting in use on the TF2 Heavy.]]
 
{{This is a|shader parameter|name=$rimlight|shader=VertexLitGeneric|since=Source 2007}} It adds a constant rim light to the model that appears to come indirectly from the environment. The color of the rim light is directly influenced by [[ambient light]] and behave closer to [[$phong#Brightness|$phongfresnelranges]] [[vector|Z component]].
{{note|Requires {{ent|$phong}} to be set to 1.}}
{{note|Requires {{ent|$phong}} to be set to 1.}}
{{note|A {{ent|$bumpmap}} is required for rimlighting to work, as {{ent|$phong}} requires one.}}
: {{TODO|Explain similarities and differences of [[Phong materials#Phong Fresnel ranges|Phong Fresnel ranges]].}}
: {{TODO|Explain similarities and differences of [[Phong materials#Phong Fresnel ranges|Phong Fresnel ranges]].}}
: {{warning|{{l4ds}} Features no visible effect. however, you can increase [[$phong#Brightness|$phongfresnelranges]] Z vector to archive a closer effect.}}


==VMT syntax==
==VMT syntax==
Line 13: Line 17:
  [[$phong]] 1
  [[$phong]] 1
   
   
  [[$bumpmap]] <texture>
  [[$bumpmap]] <[[texture]]>
  $phongexponent 5
  [[$phong#Masking|$phongexponent]] 5
  $phongexponenttexture <texture>
  [[$phong#Masking|$phongexponenttexture]] <[[texture]]>
  $phongboost 1.0
  [[$phong#Brightness|$phongboost]] 1.0
  $phongfresnelranges "[0 0.5 1]"
  [[$phong#Brightness|$phongfresnelranges]] "[[vector|[0 0.5 1]]]"
   
   
  $rimlight              1
  $rimlight              1
Line 24: Line 28:
  }
  }


== Additional parameters ==
== Additional Parameters ==
 
{{MatParamDef|$rimlightexponent|int|Exponent for phong component of rim lighting. The rim exponent defines the "tightness" of the highlight. A higher exponent results in a smaller, tighter highlight while a lower exponent results in a broader flatter one. {{bug|Appears to have no effect in HLMV.}}}}
{{MatParam|$rimlightexponent|int|Exponent for phong component of rim lighting. The rim exponent defines the "tightness" of the highlight. A higher exponent results in a smaller, tighter highlight while a lower exponent results in a broader flatter one.}}
{{MatParamDef|$rimlightboost|float|Additive boost for ambient cube component of rim lighting.}}
{{MatParam|$rimlightboost|int|Boost for ambient cube component of rim lighting.}}
{{MatParamDef|$rimmask|bool|Uses the alpha channel of the <code>$phongexponenttexture</code> to mask rimlighting.}}
{{MatParam|$rimmask|bool|Uses the alpha channel of the $phongexponenttexture to mask rimlighting.}}
{{MatParamDef|$phongtint|RGB matrix|By default the rim light is white, This will tint both, phong and rim lighting. See [[$phong#Colors|Phong]] for more.}}


== See also ==
== See also ==
 
* {{ent|$phong}}
* [[$phong]]
* [[Phong materials]]
* [[Phong materials]]
* [[Phong materials#Phong Fresnel ranges|Phong Fresnel ranges]]
* [[Phong materials#Phong Fresnel ranges|Phong Fresnel ranges]]


[[Category:List of Shader Parameters|R]]
[[Category:Shader parameters|rimlight]]
[[Category:VMT Lighting]]
[[Category:VMT Lighting]]

Latest revision as of 11:42, 23 August 2025

English (en)中文 (zh)Translate (Translate)
Example of rim lighting in use on the TF2 Heavy.

$rimlight is a material shader parameter for the VertexLitGeneric shader available in all Source Source games since Source 2007 Source 2007. It adds a constant rim light to the model that appears to come indirectly from the environment. The color of the rim light is directly influenced by ambient light and behave closer to $phongfresnelranges Z component.

Note.pngNote:Requires $phong to be set to 1.
Note.pngNote:A $bumpmap is required for rimlighting to work, as $phong requires one.
Todo: Explain similarities and differences of Phong Fresnel ranges.
Warning.pngWarning:Left 4 Dead seriesLeft 4 Dead series Features no visible effect. however, you can increase $phongfresnelranges Z vector to archive a closer effect.

VMT syntax

$rimlight <bool>
 VertexLitGeneric
{
	$phong			1

	$bumpmap		<texture>
	$phongexponent		5		
	$phongexponenttexture	<texture>	
	$phongboost		1.0
	$phongfresnelranges	"[0 0.5 1]"

	$rimlight               1
	$rimlightexponent       2
	$rimlightboost          .2			
}

Additional Parameters

Exponent for phong component of rim lighting. The rim exponent defines the "tightness" of the highlight. A higher exponent results in a smaller, tighter highlight while a lower exponent results in a broader flatter one.
Icon-Bug.pngBug:Appears to have no effect in HLMV.  [todo tested in ?]
Additive boost for ambient cube component of rim lighting.
Uses the alpha channel of the $phongexponenttexture to mask rimlighting.
By default the rim light is white, This will tint both, phong and rim lighting. See Phong for more.

See also