Mapping/Entity Rendering

From Sven Co-op
Jump to navigation Jump to search

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 and reference:

Rendering solident.png
Sprite render.png
Model render.png
Renderfx.png


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 obsolete.
  • 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.