Эта статья документации для всего, что использует платформу Source. Нажмите для получения дополнительной информации.

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).

AltNames.pngAltNames: Этот объект также именуется как static_prop.
Note.pngПримечание:К моделям с материалами, использующими маску рельефа $bumpmap(en), никогда не применяется вершинное освещение.

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

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Совет:Useful for thin, translucent objects such as leaves on foliage props.
Alpha (renderamt) <целое число(en)> (Во всех играх начиная с Left 4 Dead)
Alpha of the fade, where 0 is fully transparent and 255 is fully opaque.
Render Color (R G B) (rendercolor) <цвет КЗС(en)> (Во всех играх начиная с Left 4 Dead)
Tint the model with this color.
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)
The resolution of the generated lightmap in the X (or U) and Y (or V) direction. (Only used if Generate Lightmaps is enabled.)
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)
A multiplier for the size of the static prop model.
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)>
The model(en) this entity should appear as. 128-character limit.
Skin (skin) <целое число(en)>
Some models have multiple skins(en). This value selects from the index, starting with 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.  [нужно проверить в ?]
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)
The method by which the fading distance should be determined. If disabled, the fade distances is the distance from the player's view to the object, in inches. If enabled, the fade distance is the size of the object onscreen, in pixels. Если включено, реквизит будет постепенно исчезать на основе экранных пикселей, которых он покрывает. Дистанции начала и конца и исчезновения обозначают пиксели, покрываемые реквизитом в начале и конце его исчезновения когда это включено.
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) выбор> Отсутствует в FGD! (Во всех играх начиная с Left 4 Dead)
Не отображать для игроков с уровнем детализации оттенений, превышающим минимум или максимум.
Варианты
  • 0: По умолчанию ("Low" for mingpulevel, "Very High" for maxgpulevel)
  • 1: Низкий
  • 2: Средний
  • 3: Высокий
  • 4: Очень высокий
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.

In engine versions prior to CS:GO engine branchCSGO(en) and Strata Source Strata Source, if any material on the prop's model uses normal mapping ($bumpmap, $normalmap or $phong), per-vertex lighting will be forcibly disabled. This happens if any of the skins use $bumpmap or $phong, even if it's not the selected active skin.

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. However, just like with per-vertex lighting, this feature cannot be used together with $bumpmap, $phong or $normalmap.

When baking a lightmap for a model, VRAD will use the same UV and scaling as the $basetexture of the model's first material of its first skin (taking $basetexturetransform 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) limits the max number of entities on a map, including internal entities(en), and because prop_static count toward that limit, having too many can make the compile fail.

  • In Source 2007Source 2013Версия платформы Left 4 Dead there can be up to 8192 entities (counting static props);
  • In Alien Swarm engine branchPortal 2 engine branch up to 16384;
  • In CS:GO engine branch up to 20480;
  • In Mapbase up to 65536 (works with any Source 2013 Singleplayer game).

Because, again, that limit concerns all map entities, the realistic maximum amount of static props will be lower.

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.

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

Для обеспечения согласованности поведения объектов, модели со встроенными физическими данными(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.

The prop is not currently compatible to be used as prop_static. Note that this does not necessarily mean the model cannot be used with prop_static.

If the model does not have "static" flag in the model viewer (as in, was not compiled with $staticprop):

If the model is your custom model:

$KeyValues
{
	prop_data 
	{
		"base" "Metal.Medium"
		"allowstatic" "1"
	}
}

If it is not your custom model, but has the "static" flag in the model viewer (was compiled with $staticprop:

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

If for some reason your model located incorrectly, check declared bone name in $definebone of a model; it should be without any slashes. Also check position there, values should be zeroed.

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