prop_static

From Valve Developer Community
< Ru
Jump to navigation Jump to search
English (en)Español (es)Hrvatski (hr)Русский (ru)中文 (zh)Translate (Translate)
Info content.png
This translated page needs to be updated.
You can help by updating the translation.
Also, please make sure the article complies with the alternate languages guide.(en)
This notice is put here by LanguageBar template and if you want to remove it after updating the translation you can do so on this page.


C++ Классовая структура
CStaticProp
IClientUnknown
IHandleEntity
C++ staticpropmgr.cpp

Не путайте с командой QC $staticprop(en).

prop_static - это внутренний(en) точечная энтити(en), доступно для всех игр на движке Source Source. Он используется для дешёвого(en) добавления моделей(en) в мир. Он не может двигаться, видоизменяться в анимации или использоваться системой ввода/вывода(en). И на самом деле не является обычным объектом мира после компиляции карты. В большинстве случаев модели, добавляемые на карты, создаются как объекты prop_static.

Prop_static будет сталкиваться с другими объектами если имеет габарит столкновений(en), и, в отличии от всех других модельных объектов, освещается вершинным освещением и отбрасывает тени на карты освещения(en).

Note.pngПримечание: В отличие от большинства других типов объектов реквизита(en), prop_static не расходует лимит записей Edict_t(en), а учитывается общим лимитом объектов VBSP .
AltNames.pngAltNames: Этот объект также именуется как static_prop.

Ключ-параметры

Collisions (solid) <целое число(en) выбор>
Принцип взаимодействия реквизита с другими объектами.
  • 0 - Not solid (Бесплотный, без столкновений)
  • 2 - Use bounding box (Использовать ограничивающий короб)
  • 6 - Use VPhysics(en) (Использовать VPhysics(en)) (по умолчанию)
    Note.pngПримечание: Использование этого варианта с моделями без габарита столкновений(en) приведёт к выводу предупреждения при загрузке карты, и будет применён вариант без столкновений. Если увидите такое предупреждение, измените этот ключ-параметр у всех объектов реквизита, использующих такую модель, на один из других вариантов.
Disable per-vertex lighting (disablevertexlighting) <булева переменная(en)> (Во всех играх начиная с Source 2006)
Реквизит будет освещён равномерно при помощи значения освещения, скопированного с его исходной точки. Включите это, если объект не затеняется другим объектом.
Icon-Important.pngВажно: Enabling this overrides generatelightmaps!
Icon-Bug.pngБаг:Cascade shadows from Black Mesa Black Mesa doesn't work properly with prop_static if vertex lighting is enabled. Use this property if cascade lighting hits a static prop. This looks better if used -StaticPropLighting3 VRAD compile parameter, but it's still recommended.
Example.
Disable Self-Shadowing with per-vertex lighting (disableselfshadowing) <булева переменная(en)> (Во всех играх начиная с Source 2006)
Реквизит не будет отбрасывать тени на себя когда вычисляется вершинное освещение.
Ignore surface normal for computing per-vertex lighting (ignorenormals) <булева переменная(en)> (Во всех играх начиная с Source 2007)
Игнорировать нормали поверхности граней при расчёте вершинного освещения, что приводит к более равномерному затенению.
Tip.pngСовет: Подходит для тонких, полупрозрачных деталей, таких как листья реквизита растительности.
Alpha (renderamt) <целое число(en)> (Во всех играх начиная с Left 4 Dead)
Значение альфа-канала для сокрытия объекта, где 0 означает полностью невидимый и 255 - полностью видимый.
Render Color (R G B) (rendercolor) <цвет КЗС(en)> (Во всех играх начиная с Left 4 Dead)
Оттенок визуализации модели объекта.
Note.pngПримечание: For games before L4D like Source 2013, you can use this tool as a alternate
Generate (and use) lightmaps for this static prop (generatelightmaps) <булева переменная(en)> (Во всех играх начиная с Source 2013 Multiplayer) (также в Garry's Mod)
Generate a lightmap for this prop, in addition to fallback per-vertex lighting. Requires -StaticPropLighting to be enabled in VRAD. For more information, visit tf2maps.net.
Note.pngПримечание: Lightmapping can be also faked on static props using $detailblendmode(en) 8 or the Modulate(en) shader in all games, although syncing the lighting can be difficult.
Warning.pngПредупреждение: Several caveats and limitations; see explanation above.
Note.pngПримечание: (нет в Black Mesa) While this KV does exist in Black Mesa's FGD, it is unused; Xengine(en) does not support lightmapped props(en).
Lightmap Resolution X (lightmapresolutionx) <целое число(en)> (Во всех играх начиная с Source 2013 Multiplayer) (также в Garry's Mod)
Lightmap Resolution Y (lightmapresolutiony) <целое число(en)> (Во всех играх начиная с Source 2013 Multiplayer) (также в Garry's Mod)
Размерности создаваемых карт освещения по осям X (или U) и Y (или V). (Используется если включен параметр Создавать карты освещения.)
Icon-Important.pngВажно: Setting a high resolution will significantly slow down VRAD compile times and may look out of place compared to the much lower resolution brush and displacement lightmaps.
Enable Bounced Lighting (enablelightbounce) <булева переменная(en)> (Во всех играх начиная с CS:GO engine branch) (также в Garry's Mod)
Whether VRAD should create indirect lighting from this prop.
Note.pngПримечание: This KV is parsed by VBSP++, but VRAD++ does not currently support static prop bounce. The flag(en) used by Garry's Mod Garry's Mod's VRAD is written.
Disable Prop Combine (preventpropcombine) <булева переменная(en)> (Во всех играх начиная с CS:GO engine branch)
Prevent this static prop from combining with any other static props in VBSP.
Uniform Scaling (uniformscale) <число с плавающей запятой(en)> (Во всех играх начиная с CS:GO engine branch)
Масштаб размера модели статичного реквизита.
Icon-Bug.pngБаг:In Hammer, undoing/redoing any changes (whether they are slight unit movements or scale changes) will result in the prop appearing "normal" sized in the 3D Textured Viewport (the model only appears normal sized and the value given is still shown upon reload of the VMF).  [нужно проверить в ?]
Нужно сделать: add scaling kvs from p2ce
Name (targetname) <объект источник(en)> (только в The Ship: Murder Party)
Имя объекта, по которому другие объекты ship_base_interaction(en)The Ship: Murder Party могут ссылаться на этот объект [Как?]. Also useful regardless of game for being able to recognize specific prop_static entities in Entity Report(en). The name will not be in the compiled BSP.

Studiomodel:

World Model (model) <модель(en)>
Имя модели(en) для визуализации объекта. Ограничение длины в 128 символов.
Skin (skin) <целое число(en)>
Некоторые модели имеют множественные облики(en). Нумерация обликов начитается с 0.
Tip.pngСовет: Hammer's model browser automatically updates this value if you use it to view different skins.
Icon-Bug.pngБаг:Static props with multiple skin(en)s will always calculate texture shadows(en) based upon the alpha channel(s) from the default skin's texture(s), even though the alternative skins' alpha textures are loaded by VRAD.  (подтверждено в: Day of Defeat: Source)
Lighting Origin (LightingOrigin) <целевой объект(en)>
Select an entity (preferably info_lighting) from which to sample lighting instead of the entity's origin(en), if per-vertex lighting is disabled on this prop. Also used, regardless of how model is lit, to dictate where to grab the nearest env_cubemap from.

Тени:

Disable Shadows (disableshadows) <булева переменная(en)>
Prevents the prop from casting shadows onto lightmaps and other static props. Does not affect shadow mapping.
Icon-Bug.pngБаг:Shadows cast from static props do not influence ambient cube(en)s, causing dynamically lit entities which are in the static props' shadows to be lit as if they weren't in the shadows. (подтверждено в: Counter-Strike: SourceDay of Defeat: SourceGarry's Mod)
PlacementTip.pngОбходной приём: For particularly large solid props which are lit purely by the sun (such as buildings), it may be desirable to place blocklight(en) brushes inside the prop. Of course, this doesn't work for props with cutouts or transparency (such as large trees), and care will need to be taken with the shape of the brush to ensure it doesn't shadow the prop. Additionally, this sometimes doesn't work for props which are indoors or already in the shade, as the blocklight shadows will multiply with the prop shadows, resulting in the lightmap shadows being too dark.
Disable Shadow Depth (disableshadowdepth) <булева переменная(en)> (Во всех играх начиная с Counter-Strike: Global Offensive)
Отключение отображения глубины теней (для проецируемых текстур) на этом объекте.
Disable flashlight (disableflashlight) <булева переменная(en)> (Во всех играх начиная с Portal 2)
Отключение проецируемого текстурного освещения и теней на этом объекте.
Render in Fast Reflections (drawinfastreflection) <булева переменная(en)> (Во всех играх начиная с Portal 2)
If enabled, this entity will render in fast water reflections (i.e. when a water material specifies $reflectonlymarkedentities) and in the world impostor pass.
Note.pngПримечание: Отключение теней применяется на тени карт освещения(en) для prop_static, не RTT.

BaseFadeProp:

Start Fade Dist (fademindist) <число с плавающей запятой(en)>
Distance at which the entity starts to fade.
End Fade Dist (fademaxdist) <число с плавающей запятой(en)>
Max fade distance at which the entity is visible.
  • If start fade is <0, the entity will disappear instantly when end fade is hit.
  • If end fade is <0, the entity won't disappear at all. (This is the default behavior.)
The values will scale appropriately if the entity is in a 3D Skybox.
Fade Scale (fadescale) <число с плавающей запятой(en)>
If you specify so in worldspawn, or if the engine is running below DirectX 8 (DX7 in Source 2006), props will fade out even if the fade distances above aren't specified. This value gives you some control over when this happens: numbers smaller than 1 cause the prop to fade out at further distances, while those greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also the QC command $noforcedfade.
Screen space fade (screenspacefade) <булева переменная(en)> (удалено начиная с Portal 2)
Принцип определения расстояния исчезновения. Если параметр отключен, дальность определяется как расстояние от точки обзора до объекта в дюймах. Если параметр включен, дальность определяется по размеру объекта на экране в пикселях.
Minimum / Maximum DX Level (mindxlevel / maxdxlevel) <целое число(en) выбор> (удалено начиная с Left 4 Dead)
Объект не будет существовать, если движок будет работать вне указанного диапазона версий DirectX(en).
Варианты
Warning.pngПредупреждение: If these are used, the object may break when the user switches their DirectX settings.[missing string]
Tip.pngСовет: Set maxdxlevel to lower nonzero number such as 1 or 50 (along with disablevertexlighting set to 1) to create a prop that can cast shadows, but isn't rendered in-game. This is cheap(en)er than using blocklight(en) brushes, as it does not count towards brush and brushside(en) limits.
Minimum / Maximum Effect Details Level (mincpulevel / maxcpulevel) <целое число(en) выбор> (Во всех играх начиная с Left 4 Dead)
Не отображать для игроков с уровнем детализации эффектов, превышающим минимум или максимум.
Варианты
  • 0: По умолчанию ("Low" for mincpulevel, "High" for maxcpulevel)
  • 1: Низкий
  • 2: Средний
  • 3: Высокий
Minimum / Maximum Shader Details Level (mingpulevel / maxgpulevel) <целое число(en) выбор> (Во всех играх начиная с Left 4 Dead)
Не отображать для игроков с уровнем детализации оттенений, превышающим минимум или максимум.
Варианты
  • 0: По умолчанию ("Low" for mingpulevel, "Very High" for maxgpulevel)
  • 1: Низкий
  • 2: Средний
  • 3: Высокий
  • 4: Очень высокий
См. также: cpu_level / gpu_level convars
Tip.pngСовет: Set mingpulevel or mincpulevel to a very large number such as 20 (along with disablevertexlighting set to 1) to create a prop that can cast shadows, but isn't rendered in-game. This is cheap(en)er than using blocklight(en) brushes, as it does not count towards brush and brushside(en) limits.
Pitch Yaw Roll (Y Z X) (angles) <углы(en)>
Ориентация этого объекта в мире. Тангаж (pitch) - поворот по оси Y, рысканье (yaw) - поворот по Z и крен(roll) - поворот по X.

Известные ограничения

Вершинное освещение

Демонстрация различия освещения статичного реквизита с использованием и без использования маски рельефа $bumpmap(en) в Source 2013 Source 2013 на модели автомобиля из Day of Defeat: Source Day of Defeat: Source. Обратите внимание на различия в реалистичности освещения автомобиля, стоящего под мостом.

Lighting(en) can behave differently on a particular static prop depending on its settings and how its model and materials were authored. A prop with disabled per-vertex lighting will be vertex-lit based on its $illumposition or lightingorigin and appear similar to dynamic props(en). This is the only behavior available in Source 2004.

With per-vertex lighting enabled (available since Source 2006 via -StaticPropLighting), VRAD(en) will calculate and bake lighting and color information for each vertex of the model, typically resulting in a better, more realistic in-game look.

However, sometimes it can lead to undesireable stretches of shadow or highlights, especially on low-poly models or props with elongated proportions, like trees. The higher the poly count, the more accurate per-vertex lighting can be. It can become expensive(en) on very high-poly models, so creating LOD(en)s is advisable.

В версиях платформы, предшествующих CS:GO engine branchCounter-Strike: Global Offensive и Strata Source Strata Source, если какой-либо материал модели реквизита использует маску рельефа ($bumpmap(en), $normalmap(en) или $phong(en)), вершинное освещение будет принудительно отключено. Это происходит, если в любом из обликов используется $bumpmap или $phong, даже если он не выбран.

The CS:GO engine branch CS:GO engine branch and derivatives support per-vertex lighting on normal-mapped and $phong materials, and do not suffer from this limitation. However, if any prop is normal-mapped, all props will be lit as if they were normal-mapped, increasing VRAD compile times.

Карты освещения на статичном реквизите

In Source 2013 Multiplayer Source 2013 Multiplayer, Ветвь Team Fortress 2 Ветвь TF2, and Garry's Mod Garry's Mod, VRAD can apply lightmap(en)s onto static props, allowing for better blending between brush(en) geometry and models. Однако, как и в случае с вершинным освещением, эта функция не может использоваться совместно с $bumpmap(en), $phong(en) или $normalmap(en).

When baking a lightmap for a model, VRAD will use the same UV and scaling as the $basetexture(en) of the model's first material of its first skin (taking $basetexturetransform(en) into account, if present).

This means that:

  • Models created with overlapping UV islands will get bad lightmaps, as they'll also be overlapping;
  • If the model has multiple skin(en)s and or materials(en), only the first one will be used to lay down the lightmaps, potentially making overlapping worse;
  • The lightmap will be cropped by the UV edges (tiling UVs are not supported);
  • Low-res lightmaps can bleed over the edges of the UV.

To make matters worse, the lightmap generated for props by vanilla VRAD comes as RGB888 (24-bit SDR) in a special PPL(en) format, which can make color banding noticeable in HDR(en) mode (especially if a light source is close to the prop). Garry's Mod Garry's Mod generates and uses separate RGBA16161616f lightmaps for HDR mode.

Finally, models with LoD(en)s will have a lightmap generated for each LoD, which can greatly increase the amount of VRAM used by an individual prop, making level of detail models potentially more expensive(en) than always using the highest quality model.

See the $lightmap(en) page for a full list of caveats with lightmapped props.

PlacementTip.pngОбходной приём: A modified VRAD can generate HDR lightmaps for static props, at the expense of additional VRAM usage; see PPL(en) for more information.
Tip.pngСовет:
  • Propper++ Propper++ can bake a model's $basetexture(en) into a non-overlapping non-tiling atlas, mitigating some of these issues at a minor quality loss.
  • Use the QC command $checkuv 0to1 overlap to prevent a model from compiling if it has incompatible UVs.

Ограничения компилятора для статичного реквизита

VBSP(en) имеет ограничение максимального количества объектов на карте, включая внутренние объекты(en), и поскольку prop_static расходует этот лимит, слишком большое количество таких объектов может привести к сбою компиляции.

  • В Source 2007Source 2013Версия платформы Left 4 Dead может быть до 8192 объектов (считая статичный реквизит);
  • В Alien Swarm engine branchPortal 2 engine branch - до 16384;
  • В CS:GO engine branch - до 20480;
  • В Mapbase - до 65536 (работает в любой Source 2013 Singleplayer игре).

Поскольку, это ограничение учитывает все объекты карты, реальное максимальное количество объектов статичного реквизита будет меньше.

Tip.pngСовет: This is a soft limit, and a modified VBSP(en) can change it (MAX_MAP_ENTITIES in public/bspfile.h). A BSP file can theoretically contain over 4 billion static props.
Warning.pngПредупреждение: Exceeding such soft limit in the map will cause issues such as crashes when using BSPZIP(en) and when building cubemaps. To avoid these issues, remove bsppack.dll, and pack/compress manually with BSPZIP++(en) afterwards (or, if not compressing the map, use VPKEdit VPKEdit to pack).

Принудительная согласованность

Для обеспечения согласованности поведения объектов, модели со встроенными физическими данными(en) не могут быть prop_static, если не используется allowstatic. Используйте вкладку Info (Информация) в Обзоре моделей Hammer, чтобы проверить совместимость.

PlacementTip.pngОбходной приём: Это не ограничение платформы, проверка выполняется компилятором. Модифицированный VBSP(en) может это исправить. Смотрите ниже.

Модели с частями тела

Prop_static does not support selectable $bodygroup submodels; if there are any, only the first one will be used by the game. Despite this, VRAD will generate lightmap shadows from all submodels present in the MDL! (tested in Day of Defeat: Source)

PlacementTip.pngОбходной приём: Either compile a separate model for each desired variation (doesn't use up an edict(en), better lighting), or use prop_dynamic (easier, less file duplication).

Модели с наборами обликов

While prop_static does support selectable $texturegroup skins, VRAD does not properly load the appropriate skin. Since VRAD only cares about the alpha channel of the textures, this is only an issue for materials that would cast texture shadows(en). Texture shadows will be cast based upon the first skin, even though the alpha textures for the other skins are loaded into memory. (tested in Day of Defeat: Source)

Распространённые ошибки

VBSP удаляет модель

Error! prop_static using model "[model]", which must be used on a dynamic entity (i.e. prop_physics). Deleted.

В таком виде модель неподходит для использования в качестве prop_static. Обратите внимание, что это не означает, что модель не получится использовать с prop_static.

Если модель не имеет признака "static" в программе просмотра моделей (была скомпилирована без $staticprop):

  • Вместо этого необходимо использовать объекты prop_dynamic или prop_physics_override, если нужны физические взаимодействия.

Если это созданная вами модель:

  • Значит, либо в QC(en)-файле модели отсутствует $staticprop(en), либо в данных prop_data отсутствует значение allowstatic 1. Пример:
$KeyValues
{
	prop_data 
	{
		"base" "Metal.Medium"
		"allowstatic" "1"
	}
}

Если эта модель создана не вами, и она имеет признак "static" в программе просмотра моделей (была скомпилирована с $staticprop):

  • В Garry's Mod, добавьте -allowdynamicpropsasstatic в параметры компилятора VBSP(en).
  • В Ветвь Team Fortress 2, используйте VBSP++ VBSP++ и добавьте -allowdynamicpropsasstatic в параметры компилятора VBSP(en).
  • В Source 2013 Singleplayer или Source 2013 Multiplayer, используйте VBSP от Slammin' Source Map Tools Slammin' Source Map Tools (Source 2013 Singleplayer или Source 2013 Multiplayer), VBSP prop_static fix ((только в src13sp) ), Mapbase Mapbase (Source 2013 Singleplayer only), or Garry's Mod Garry's Mod (Source 2013 Multiplayer only).
  • В иных случаях, используйте Source Model Skin Editor Source Model Skin Editor, чтобы добавить "allowstatic" "1" в prop_data модели(en), и вернуться к работе над исходниками модели после компиляции карты.
Warning.pngПредупреждение: -allowdynamicpropsasstatic can force anything to be a static prop. Should the prop have more than one bone, the extra bones will randomly attach themselves to various entities at runtime, including the players viewmodel!
This can also happen on breakable props that have no moving parts, but use bones to spawn the gibs at specific locations.

Смещённая модель

Если по какой-то причине модель расположена неправильно, проверьте указанное имя кости в $definebone модели, оно должно быть без косых черт. Также проверьте координаты местоположения кости, значения должны быть нулевыми.

Смотреть также