Entity Rendering

Modified

06-Jul-2023

Introduction


Using the GoldSrc engine, visible entities will either be rendered as a whole or not at all. This applies to visible brush entities and any entity using a model file for visual appearance. Up to 256 can be rendered at the same time, which should be sufficient for most maps. Below is explained the different render-modes and how they work. These won't be listed on entities in this guide unless they supply special functionality on it.

Render Modes Preview


Solid Entity Render Mode
Normal Preview Default render mode.
Color Preview Preview Preview Preview Replace texture with chosen color in FX Color.
255 165 70 25 Fx Amount
Texture Preview Preview Preview Preview Applies transparency to brush.
255 165 70 25 Fx Amount
Glow Does not work on solid entities
Solid Preview Preview Removed blue color from textures tagged with '{' (render FX is 255).
Editor preview Game preview
Additive Preview Preview Preview Preview Adds the texture colors to background. Darker colors become less visible- black color is removed. Glowing in the darkness.
255 165 70 25 Fx Amount


Sprite Render Mode
Normal Use other than normal render mode to remove sprite background.
Color Use "Glow" render mode instead to set color.
Texture Use "Glow" or "Additive" render mode instead.
Glow Preview Preview Preview Preview Removes black background from sprites. Color can be applied. Resizes as the player approaches.
255 165 70 25 Fx Amount
Solid Does not affect sprites.
Additive Preview Preview Preview Preview Add sprite colors to the background. Darker colors become less visible- black color is removed. Glowing in the darkness. No resizing.
255 165 70 25 Fx Amount


Model Render Mode
Normal Preview Default render mode.
Color Does not affect models.
Texture Preview Preview Preview Preview Applies a transparency to model.
255 165 70 25 Fx Amount
Glow Does not affect models.
Solid Does not affect models.
Additive Preview Preview Preview Preview Add texture colors to the background. Darker colors become less visible- black color is removed. Glowing in the darkness.
255 165 70 25 Fx Amount


Render Modes and Amounts


The following render-modes exist:

Normal: Normal rendering. Entity will receive light, except if it is a sprite. Render-amount is redundant.

Color: Brush entities only: Instead of rendering the texture, the whole entity will appear in one color, set by render-color. Render-amount sets the transparency. 0 means invisible. 255 means fully opaque.

Texture: Texture-only rendering. Entity will not receive light. Instead, only the texture will be rendered as is. Render-amount sets the transparency. 0 means invisible. 255 means fully opaque. This is used for transparent things such as windows. Tip: If you have a window separating a dark and a bright room using only one entity, you can apply a brighter glass texture to the side of the window seen from within the dark room than to the side seen from the bright room. That way, the window's brightness will look realistic from both sides, instead of from just one. Generally, darker rooms require the render amount to be lower, making the glass more transparent, or it would look illogically bright.

Glow: Sprites only. The sprite will appear in the same size regardless of your distance to it. In addition to that, the further away you are from it, the less visible it will be. (It's only barely visible at about 500 units far away) Good for light coronas. This renders the sprite in additive mode. See the additive render-mode below for how to use render-amount.

Solid: Brush entities only. All textures of the brush entity starting with '{' will have the last color of their palette (usually blue, black or purple) be rendered fully transparent. This is used for textures with see-through parts, such as grates and railings. Requires render-amount to be set to a value greater than 0, commonly 255. Light is rendered as it normally would; for normal textures on an entity with this render-mode as well.

Additive: Works just as the render-mode 'Texture', except that the entity's appearance will be added to the background instead of forming a mean. This means, black pixels of textures will be fully transparent, while full-bright pixels are added with a factor of render-amount divided by 255. This is often used for sprites indicating a glowing light, as well as for overlay func_illusionaries to give a computer texture the appearance of having many small, glowing lights, screens and whatever other elements. Render-amount of 255 makes it bright. 0 makes it invisible.

Render FX


Special effects can be added by specifying Render FX. Render FX works only when reder mode is different than Normal. The following render-fxes exist:

Normal: Default render mode, no special effects.

Pulse: Transparency fading in, fading out (looped). The range is small or wide and total range can be changed with render FX amount.

Strobe: Regular appearing and disappearing (looped).

Flicker: Random appearing and disappearing (looped).

Fade Away: Fades out until reaching invisibility. Works once when entity spawns or have changed it's Redner FX in real time (e.g. through env_render entity). Requires high FX Amount.

Become Solid: Fades in from invisible to visible. Works once when entity spawns or have changed it's Redner FX in real time (e.g. through env_render entity). Requires low or zero FX Amount.

Constant Glow: Sprites with "Glow" render mode only. Disables sprite resizing by distance.

Distort: Random distortion (looped).

Hologram: Random distortion with Pulse applied (looped).

Dead Player: Should not be used.

Explode: Affects only monsters and players. Works once, stretches model horizontally then makes it dissapear.

Glow Shell: Applies nice animated glowing shell on model. Color can be applied. FX amount manipulates glow size.

Clamp Minimum Scale: Prevent sprites from getting too small.