prop_static
prop_static
is a internal point entity available in all Source games.
It is used to cheaply add a model to the world. It cannot move, animate, or accept input (with the limited exception of $treesway
). In fact, it doesn't exist as an entity after the map has been compiled. The vast majority of models in a typical map are prop_static
s.
A prop_static
will collide with other objects assuming it has a collision mesh, and, unlike all other model entities, can be lit per-vertex and cast shadows onto lightmaps.
$phong
cannot be lit per-vertex, except in the CS:GO engine branch and Strata Source, and will be lit based upon the model's origin instead!Additionally, lighting seams may appear on edges with non-contiguous texture UVs; this is more noticeable on lower-resolution lightmaps.
$lightmap
in the VMT of the VertexLitGeneric material (can be obtained using -dumppropmaps
in VRAD).
- Define a pre-baked RGBA16161616f
$lightmap
in the VMT of the VertexLitGeneric material. A custom-coded compiler would be required to this accurately. - Increase lightmap resolution (results may vary).
- Move light source further away from the lit surface.
$bumpmap
parameter is defined for a material, a custom shader cannot simply use both as there are a dozen technicalities that have to be overcome.
If This in-engine check also exists for $phong, however getting around the issue is more tricky. The default value of the integer parameter will be 0 even if not set in the vmt. Thus making $phong always be defined in a way. |
- 8192 MAX_MAP_ENTITIES
- 16384 MAX_MAP_ENTITIES
- 20480 MAX_MAP_ENTITIES
- 65536 MAX_MAP_ENTITIES (supports all games)
In practice, the maximum number of prop_statics will be less than this, due to the limit being shared between all entities in the map.
public/bspfile.h
. A BSP file can theoretically contain over 4 billion static props.prop_static
does not support selectable $bodygroup
submodels (although it does support selectable $texturegroup
skins); only the first one will be used. Despite this, VRAD will generate lightmap shadows from all submodels present in the MDL! (tested in ) - Compile a separate model for each desired variation (doesn't use up an edict, better lighting)
- Use
prop_dynamic
(easier, less file duplication)
Consistency
In order to enforce consistency of behavior, models with embedded physics data cannot be prop_static
. Use the Hammer Model Browser's info tab to check for support.
Keyvalues
- Collisions
(solid)
<choices> - How the prop should interact with other objects.
- Not solid
- Use bounding box
- Use VPhysics (default) Note:Using this setting on models without a collision mesh will cause the engine to throw a warning upon loading the map. If you see such a warning, reset the collision of all props using the noted model to one of the other two choices.
- Screen Space Fade
(screenspacefade)
<boolean> - If enabled, the prop will fade out based on how many screen pixels it covers. The start and end fade distances come to represent the pixels that the prop covers at the start and end of its fade when this is enabled.
- Lighting Origin
(lightingorigin)
<targetname> - An
info_lighting
from which to sample lighting (instead of the model's origin). Disables per-vertex lighting.
- Disable Vertex lighting
(disablevertexlighting)
<boolean> - Prop will be vertex lit more similarly to dynamic props, being lit based upon its origin instead of per-vertex. Set this to "Yes" to significantly reduce VRAD compile times if the prop does not benefit from complex lighting.
- Risk of Confusion:This doesn't actually disable vertex lighting, but rather uses a simpler form of it that calculates vertex colors based upon the color, brightness, and direction of the origin (or
$illumposition
) at runtime instead of prebaking the them per-vertex into a VHV file (which is packed into the compiled BSP). - Important:Enabling this overrides
generatelightmaps
!
- Disable Self-Shadowing with vertex lighting
(disableselfshadowing)
<boolean> - When vertex lighting is enabled, prevent the geometry from self-shadowing (casting shadows onto itself).
- Ignore surface normal for computing vertex lighting
(ignorenormals)
<boolean> - When vertex lighting is enabled, ignore the surface normal of faces when calculating the vertex lighting, resulting in more uniform shading.
- Tip:Useful for thin, translucent objects such as leaves on foliage props.
- Alpha
(renderamt)
<integer> (in all games since ) - Alpha of the fade, where 0 is fully transparent and 255 is fully opaque.
- Render Color (R G B)
(rendercolor)
<color255> (in all games since ) - Tint the model with this color.
- Generate (and use) lightmaps for this static prop
(generatelightmaps)
<boolean> (only in ) (also in ) - Generate a lightmap for this prop. Requires
-StaticPropLighting
to be enabled in VRAD. For more information, visit tf2maps.net. - Note:Lightmapping can be also faked on static props using the Modulate shader in all games, although syncing the lighting can be difficult.
- Warning:Several caveats and limitations; see note and warnings above.
- Note:(not in ) While this KV does exist in Black Mesa's FGD, it is unused; Xengine does not support lightmapped props.
- Lightmap Resolution X
(lightmapresolutionx)
<integer> (only in ) (also in ) - The resolution of the generated lightmap in the X (or U) direction. (Only used if Generate Lightmaps is Yes.)
- Lightmap Resolution Y
(lightmapresolutiony)
<integer> (only in ) (also in ) - The resolution of the generated lightmap in the Y (or V) direction. (Only used if Generate Lightmaps is Yes.)
- Enable Bounced Lighting
(enablelightbounce)
<boolean> (in all games since ) - Whether VRAD should create indirect lighting from this prop.
- Disable Prop Combine
(preventpropcombine)
<boolean> (in all games since ) - Prevent this static prop from combining with any other static props in vbsp.
- Uniform Scaling
(uniformscale)
<float> (in all games since ) - Evenly scales a given model along the X Y Z axis.
- Bug: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).
- Name
(targetname)
<targetname> (only in ) - The name that
ship_base_interaction
/postcompile entities refer to this entity by.
Studiomodel:
- Skin
(skin)
<integer> - Some models have multiple skins. This value selects from the index, starting with 0. Tip:Hammer's model browser automatically updates this value if you use it to view different skins.Bug:Static props with multiple skins will always use the alpha channel(s) from the default skin's texture(s), even though the alternative skins' alpha textures are loaded by VRAD. (tested in )Tip:This bug can be exploited give the appearance of casting lightmap shadows from the alpha channel of brushes or displacements on vanilla compilers, by creating a static prop with two skins: one with the same texture as the brush, and the other with
$no_draw 1
, and setting the prop's skin to the latter.
(uniformscale)
<float> (in all games since )Shadow:
- Disable Shadows
(disableshadows)
<boolean> - Prevents the entity from creating cheap render-to-texture shadows, or lightmap shadows if the entity is a
prop_static
. Does not affect shadow mapping.
- Disable Receiving Shadows
(disablereceiveshadows)
<boolean> - Prevent the entity from receiving dynamic shadows on itself.
- Shadow Cast Distance
(shadowcastdist)
<integer> !FGD - Sets how far the entity casts dynamic shadows. 0 means default distance from the
shadow_control
entity. - Disable ShadowDepth
(disableshadowdepth)
<boolean> (in all games since ) - Used to disable rendering into shadow depth (for projected textures) for this entity.
- Disable flashlight
(disableflashlight)
<boolean> (in all games since ) - Used to disable projected texture lighting and shadows on this entity.
- Projected Texture Cache
(shadowdepthnocache)
<choices> (in all games since ) - Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
|
Reflection:
- Render in Fast Reflections
(drawinfastreflection)
<boolean> (in all games since ) - If enabled, this entity will render in fast water reflections (i.e. when a water material specifies
$reflectonlymarkedentities
) and in the world impostor pass.
}} BaseFadeProp:
- Start Fade Dist
(fademindist)
<float> - Distance at which the prop starts to fade.
- End Fade Dist
(fademaxdist)
<float> - Max fade distance at which the prop is visible.
- If start fade is <0, the prop will disappear instantly when end fade is hit.
- If end fade is <0, the prop won't disappear at all. (This is the default behavior.)
- The values will scale appropriately if the prop is in a 3D Skybox.
- Fade Scale
(fadescale)
<float> - If you specify so in
worldspawn
, or if the engine is running below DirectX 8 (DX7 in ), 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
.
DXLevelChoice:
- Minimum / Maximum DX Level
(mindxlevel / maxdxlevel)
<choices> (removed since ) - The entity will not exist if the engine is running outside the given range of DirectX Versions.
Warning:If these are used, the object may break when the user switches their DirectX settings.
|
SystemLevelChoice:
- Minimum / Maximum Effect Details Level
(mincpulevel / maxcpulevel)
<choices> (in all games since ) - Don't render for players with Effect Details levels that exceed the minimum or maximum.[Key names are related to
cpu_level
cvar used by Effect Details.]
|
- Minimum / Maximum Shader Details Level
(mingpulevel / maxgpulevel)
<choices> (in all games since ) - Don't render for players with Shader Details levels that exceed the minimum or maximum.[Key names are related to
gpu_level
cvar used by Shader Details.]
|
Angles:
- Pitch Yaw Roll (Y Z X)
(angles)
<angle> - This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Common Mistakes
VBSP deletes model
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):
- You need to use
prop_dynamic
instead, orprop_physics_override
if you want it to have physics.
If the model is your custom model:
- Either your model's QC file is missing
$staticprop
or there is noallowstatic 1
in theprop_data
. Example:
$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 , add -allowdynamicpropsasstatic to the VBSP compile options.
- If , use the VBSP from Slammin' Source Map Tools ( or only, VBSP prop_static fix ( only), or Mapbase ( only).
- Otherwise, use Source Model Skin Editor to add
"allowstatic" "1"
to the MDL'sprop_data
, then revert to the original MDL after the map is compiled.
Model is off-center
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.