env_sprite Last edited 2 months ago2024-09-06 02:19:56 UTC

Redirected from env_sprite_(Half-Life)

env_sprite - Point Entity

The env_sprite entity places a sprite within the map. It can also be used to place models, although it can only use the first submodel and skin.

Attributes

Flags

Notes

Sprite type and orientation

A sprite can be in one of these types. Depending on the type, angles (Pitch Yaw Roll) may have an effect on the sprite's orientation in the level.
Type Description Used angles value
VP_PARALLEL Always faces the camera with roll applied. The majority of sprites are in this format. Roll*
VP_PARALLEL_ORIENTED Always faces the camera with roll applied. Roll*
VP_PARALLEL_UPRIGHT Faces the camera but the pitch is always 0. Useful for tree or fire sprites. None
FACING_UPRIGHT Faces the player's origin but the pitch is always 0. Seldom used. None
ORIENTED Fixed to the set Pitch Yaw Roll value.** Useful for overlays. Pitch Yaw Roll*
* If the third (Roll) value of angles is zero, the game code swaps it with the second (Yaw, i.e. the one set by Hammer/J.A.C.K. compass) value. For ORIENTED sprites, use a non-zero Roll value e.g. 360 to prevent this.
** Oriented sprites is only visible on one side, the side facing away from angles. In other words, you only see it if you face about the same direction as the sprite's angles.
Different sprite types in game. Credit: The303Different sprite types in game. Credit: The303

Render modes and sprite texture formats

Besides Render Mode, the appearance of a sprite also depends on the texture format of the sprite file itself. There are 4 different formats: The following screenshots show 1) a normal, 2) an additive, 3) an index-alpha and 4) an alpha-test sprite, using different render modes and FX settings:
FX Amount: 255FX Amount: 255
FX Amount: 63FX Amount: 63
FX Color: 255 0 0FX Color: 255 0 0
To summarize:

Usage on models

env_sprite is also a popular choice to display static models e.g. props. The model renderer uses new attributes, or interprets them differently to sprites: The most important thing is to explicitly set the Roll in Pitch Yaw Roll to a non-zero value (e.g. 360 to stay upright), otherwise Yaw and Roll will get swapped at spawn, a behaviour unique to env_sprite.

Example maps

Loading embedded content: Vault Item #6461

1 Comment

Commented 1 year ago2022-12-20 09:33:56 UTC Comment #104936
To do: describe the weird Pitch Yaw Roll behaviour better. Relevant code: https://github.com/ValveSoftware/halflife/blob/c7240b965743a53a29491dd49320c88eecf6257b/dlls/effects.cpp#L1198

You must log in to post a comment. You can login or register a new account.