Ru/$phong: Difference between revisions
| m (Multipage removal) | Churkinator (talk | contribs)  No edit summary | ||
| Line 1: | Line 1: | ||
| {{LanguageBar}} | {{LanguageBar}} | ||
| {{Update translation}} | |||
| {{this is a|shader parameter|name=$phong|since=Source 2006|shader=VertexLitGeneric}}   | {{this is a|shader parameter|name=$phong|since=Source 2006|shader=VertexLitGeneric}}   | ||
| [[File:Alyx phong closeup.jpg|thumb|200px|Шейдер Фонг обеспечивает подсветку кожи, губ и головной повязки Аликс.]] | [[File:Alyx phong closeup.jpg|thumb|200px|Шейдер Фонг обеспечивает подсветку кожи, губ и головной повязки Аликс.]] | ||
Revision as of 03:49, 28 September 2024

You can help by updating the translation.
Also, please make sure the article complies with the alternate languages guide.
$phong  - это   материальный параметр шейдера, доступно для всех игр на движке  Source начиная с
 Source начиная с  Source 2006.
 Source 2006. 
В большинстве версиях движка доступна только с шейдером VertexLitGeneric;  Counter-Strike: Global Offensive (начиная с 2015) позволяет использовать с шейдером
 Counter-Strike: Global Offensive (начиная с 2015) позволяет использовать с шейдером LightmappedGeneric (с некоторыми ограничениями). Подробнее смотрите Фонг материалы.
VMT syntax
$phong <bool>
Шейдер Фонг должен использовать стандартные значения для любых параметров конфигурации, которые вы не включили в свой файл материала. Однако оказывается так, что это не происходит. Тем не менее, все перечисленные ниже параметры обязательны, даже если их стандартные значения не меняются.
VertexLitGeneric
{
	$phong 1
	$bumpmap				[texture]
	$phongexponent			5			// либо это
	$phongexponenttexture	[texture]	// либо это
	$phongboost				1.0
	$phongfresnelranges		"[0 0.5 1]"
}
Параметры шейдера
Masking
- $bumpmap <texture>
- Здесь должна быть карта нормалей. Ее альфа канал действует по умолчанию как маска Фонга.
- Template:L4D add
- Интенсивность Фонг основывается на яркости $basetexture.
- $BasemapAlphaPhongMask <bool>
- Заменяет маску Фонга на альфа канал $basetextureвместо карты нормалей.
- $PhongExponent <int>
- The numeric value overrides an exponent mask if present.
- $PhongExponentTexture <texture>
- An global exponent value, or a per-texel exponent texture map. In an exponent map:
- Красный канал: Exponent (size of highlight, 0-255, where a value of 0 is a large highlight, 255 small.)
- Зеленый канал: Albedo tint (if $phongalbedotint 1, higher is more tint)
- Синий канал: Nothing
- Alpha channel: $rimlightmask
 
- Template:L4D add
- Template:L4D add
- Нужно сделать: See Shading a Bigger, Better Sequel: Techniques in Left 4 Dead 2.
- $allowdiffusemodulation <int>
- [Нужно сделать]
- $DiffuseExp
- Нужно сделать: Does this have something to do with the $phongexponent, $phongexponenttexture or both?
Brightness
- $phongboost <int>
- Phong brightness factor. Larger values create a more intense highlight, useful for surfaces like metal and glass.
- $PhongFresnelRanges <matrix>
- See Phong Fresnel ranges. Default is "[0 0.5 1]".
- $PhongDisableHalfLambert <bool>Template:P2 add
- Used in Portal 2 on the Personality Cores such as Wheatley, disables functionality of $halflambert. MAY need $halflambert 0!
- $AmbientOcclusionTexture <texture>
- A "dirtmap". Mentioned in the SDK samples and seen in the VMT for Alyx's face. Ambient Occlusion is generally used for the eyes and face.
Colours
- $PhongAlbedoTint <bool>
- Allows the $basetextureto affect the colour of the Phong highlight. The amount of tint is defined by the green channel of$phongexponenttexture(see above).
- $phongtint "[<red float> <green float> <blue float>]"
- Modifies the colour of the phong reflection. The channels are interpreted relative to each other (so "[0 0 0]" and "[1 1 1]" are the same).
- $PhongWarpTexture <texture>Template:EP2 add
- Нужно сделать: Used to create an iridescence effect, as seen on npc_hunters.
Phong shading on brush faces
A May 2015 update to  Counter-Strike: Global Offensive added limited support for Phong-based highlights on
 Counter-Strike: Global Offensive added limited support for Phong-based highlights on LightmappedGeneric materials. Currently it only works when the material is directly lit by an env_cascade_lighting, using the dynamic shadows as a mask (although traditional Phong masking is supported on top of this). It is known to work on displacements as well as WorldVertexTransition materials, but not water or Lightmapped_4WayBlend.
New Parameters
- $phongMaskContrastBrightness "[<float> <float>]"
- Defines the contrast level between light and dark areas in the mask, and the overall brightness, respectively. Added along with support for phong-shaded lightmapped textures. Нужно сделать: Find out the range of both values, and whether or not it can be used on models.
- $phongAmount "[<red float> <green float> <blue float> <brightness> float]"
- Controls the tint and brightness. The fourth value can go beyond 1, but affects the brightness of the whole texture, not just the highlight.
See also
- Phong materials
- $envmap (environment map)
- $lightwarptexture
- $rimlight



























