Ru/Lightmap

From Valve Developer Community
< Ru
Revision as of 01:52, 3 March 2016 by Alvagor (talk | contribs) (→‎Scale)
Jump to navigation Jump to search

Template:Otherlang2

Карта освещённости - это сгенерированная текстура, аддитивно наложенная на поверхность LightmappedGeneric браша, чтобы имитировать освещение. Цветовые значения поверхностей альбедо умножаются на значения цвета их карты освещённости.

Карты освещённости создаёт VRAD каждый раз во время компиляции карты. Они статичны и неизменны, хотя возможно переключать 'страницы' освещённости между вкл и выкл (см. Naming Lights).

Масштаб

Масштаб карты освещения определяет её разрешение. Масштаб по умолчанию создаёт 16 пикселей ("люксел"), т.е. 16 единиц, соответственно, масштаб карты освещения 1 создаёт люксел, равный одной единице. Для изменения этого значения используется Hammer Face Edit Dialog.

Понижение масштаба делает тени острее, но увеличивает размер файла карты, слегка замедляет рендеринг и экспоненциально замедляет компилирование (а на очень низких масштабах начинает съедать безумное количество системной памяти).

Масштаб освещения 4 Масштаб освещения 16 Масштаб освещения 64
Масштаб освещения 4, 16, и 64.

Во время генерирования карт освещения, VRAD не создаёт полутеней. Тем не менее, эффект может быть имитирован путем увеличения масштаба освещения (поэтому, по-умолчанию используется относительно большое значение 16).

Note.pngПримечание:Each compiled brush polygon can host a maximum of 31x31 luxels. VBSP will chop faces to get extra luxels on if it needs to.
Tip.pngСовет:Fog will increase atmospheric scattering, making all shadows a lot more diffuse.

Optimization

Optimising lightmap scales.

Lightmap optimization can be done by eye with the aid of a compiled map: faces with low lighting contrast can have their scales increased, and vice versa faces with high contrast should be considered for lower scale. Just beware of setting a face's scale so high that it ends up a 'blob' of light that doesn't blend with its neighbors (use mat_fullbright 2 to spot this).

Remember to take into account the size of a face, too. Moving a very large face even one point up or down can have a huge impact. Don't be afraid to split the face up if that helps, or to drop a bit of detail from huge floor or wall faces.

Hammer view

Clicking the camera control in the top-left of a 3D view in Hammer provides the option of "3D Lightmap Grid". This view textures each brush surface with a grid that represents its lightmap scale (shown in the last section).

Tool brushes are textured like any other in this mode, despite being invisible in-game, so switch them all off from their auto-visgroup.

Console commands

The following are all cheats:

mat_fullbright 2
mat_fullbright 2
Replaces all albedos with a grey tone, leaving just lighting information.
mat_luxels <bool>
Display luxels on all brush surfaces.
Icon-Bug.pngБаг:Breaks on displacements  [нужно проверить в ?]
mat_filterlightmaps <bool>
Control whether luxels are smoothed together in the same way as texels.
r_avglightmap <bool>
Doom mode! Averages lightmap values across each polygon.
mat_showlightmappage <int>
Unwraps each lightmap into a small, tessellating display in the top left of the screen. Not terribly useful to modders.
r_lightmap <?>
Нужно сделать: No apparent effect.
r_unloadlightmaps <bool>
Нужно сделать: Unknown. Possibly a way of flushing lightmap data between map loads?

See Also