$envmapmask/ru

From Valve Developer Community
Jump to: navigation, search

$envmapmask - это параметр шейдера материала , доступный во всех играх на Source Source. Этот параметр определяет зеркальную маску [Specular mask], которая влияет на то, насколько сильно каждый пиксель материала отражает свет от$envmap. Маска должна быть изображением в градациях серого, в котором полностью отражающие области являются белыми, а полностью матовые области - черными. Для отражения диффузного типа, которое не зависит от$envmap,см.$phong.

Icon-Bug.pngОшибка:В играх на Source 2007 использование маски $envmapmask, которая не хранится во вложенной подпапке, приведет к сбою загрузки текстуры в игре.
Warning.pngПредупреждение:$envmapmask не будет работать с материалами, использующими карты нормалей. Посмотрите #Альтернативные_методы.

Пример синтаксиса VMT

$envmapmask <текстура>
VertexLitGeneric
{
	$envmap			env_cubemap
	$envmapmask		"props/tvscreen_test"
}

Дополнительные параметры

Зеркальная маска у npc_cscanner.
Трансформирует маску зеркальной текстуры.
Позиция по умолчанию: center .5 .5 scale 1 1 rotate 0 translate 0 0.
  1. center определяет точку вращения. Приносит пользу только при использовании rotate.
  2. scale вставляет текстуру в материал заданное количество раз. 2 1 — это 50%-ый масштаб по оси X.
  3. rotate вращает текстуру "против часовой стрелки/по часовой стрелке" в градусах. Принимает любое число, включая негативы.
  4. translate сдвигает текстуру до заданных значений. Значение .5 сдвинет текстуру на 50%.
Note.pngПримечание:Все значения должны быть добавлены!
Icon-Bug.pngОшибка:Масштабирование текстуры может вызвать странные проблемы, когда инструмент «Texture Lock» в Hammer фактически не фиксирует текстуру на месте.
Icon-Bug.pngОшибка:Вращающиеся текстуры, примененные к брашам, будут вращаться вокруг начала координат карты. Чтобы исправить это, нужно изменить центральное положение в VMT на начало координат браша.
Масштабирует зеркальную маску до заданного значения. Также, выше посмотрите на$envmapmasktransform.
Кадр для начала анимированной зеркальной маски.

CS:GO WorldVertexTransition Parameters

$envmapmask2 <texture> (only in Counter-Strike: Global Offensive)
Shader(s): WorldVertexTransition
Зеркальная маска для второго слоя WorldVertexTransition.
Shader(s): WorldVertexTransition
Трансформация текстуры для $envmapmask2.
$envmapframe2 <integer> (only in Counter-Strike: Global Offensive)
Shader(s): WorldVertexTransition
Кадр для начала анимации $envmapmask2.

Альтернативные методы

Rather than creating a whole new texture for a specular mask, you can embed one into the alpha channel of the $basetexture or $bumpmap. Model materials with $bumpmap must do this. Unfortunately, it won't reduce memory usage.

If you do use these commands, transformations and other such parameters applied to $basetexture / $bumpmap will also apply to the specular mask.

Use the alpha channel of the $basetexture as the specular mask.
Note.pngПримечание:Alpha channels embedded in $basetexture work in reverse. Transparent areas are reflective, opaque areas are matte. This is because, say, a window texture's alpha mask would be mostly black to allow for transparency -- yet that black part of the mask would also be the most reflective part. To avoid having to duplicate a texture file simply to invert the alpha mask, you can use this material parameter instead.
Note.pngПримечание:The alpha channel isn't inverted in the Source 2007 engine for models, but the alpha channel is inverted for brushes!
Icon-Bug.pngОшибка:In CSGO, this parameter breaks materials using $translucent, limiting its usefulness. Use $envmapmask instead.
Use the alpha channel of the $bumpmap as the specular mask.
Note.pngПримечание:Will not work if $basemapalphaphongmask or $basemapluminancephongmask are used.
Use the alpha channel of the $envmapmask as the $selfillum mask instead of $basetexture's alpha. In this event this command replaces $selfillum - do not use both.
Shader(s): VertexLitGeneric
Use the red channel of the $tintmasktexture as the specular mask.

Merging Specular Level into Normal Alpha in 3ds Max

To merge a Specular Level map into the Normal Map alpha, you can create a Composite Map node with the normal map in Layer 1 and the specular map in Mask 1. Then right-click the composite map, click Render Map and save this new image to file (remembering to keep the Gamma at 1.0 and using 32 bits per pixel in the save options).

These steps are automated in the Alpha Spec tool in Wall Worm 2.72+.

Также посмотрите