Render Modes

From Valve Developer Community

Jump to: navigation, search

These are all the rendering modes present in Source.

Contents

General functionality in Source

The Additive mode sprite on the left cuts through the lamp prop, while the World Space Glow mode sprite on the right is only rendered if nothing blocks it.

In Source (where most rendering modes have been crippled) there are only three reasons for changing the Render Mode keyvalue to anything else than its Normal setting:

  1. You want to render a sprite correctly (without its black box).
  2. You want to make an entity transparent.
  3. You don't want to render the entity at all.
  • If you want to render a sprite correctly, there are four modes that can do this: Glow, Additive, and their alternatives Additive Fractional Frame and World Space Glow. The two Additive modes are rendered so that the sprite will cut through any surrounding brushwork, while the two Glow modes are designed to be used for glows and other light source sprites. (See picture on the right.) Of the two Glow modes, Glow has a fixed size on screen, while World Space Glow has a fixed size in the world. This is perhaps best demonstrated visually.
  • If you want to render an entity as transparent, you need to change the mode from Normal to enable the FX Amount (0 - 255) parameter. You can use any of the other eight modes for this, except the Don't Render mode (unless you want to make it completely invisible).
  • If you don't want to render an entity at all, simply use the Don't Render mode (The entity will still be there, but remain invisible).

Normal (0)

This is the normal rendering mode. Default according to entity type, its materials settings and API compatibility (on DX7 some of materials have cheaper preporties to render).

Setting the FX Amount (0 - 255) keyvalue will have no effect on entities rendered with in this mode.

This mode is not recommended for sprites. (Will not render sprite alpha transparency.)

Color (1)

To do: This mode will render entities in degrees of both color and opacity, but so will most of the other modes, so this mode seems to be obsolete.

This mode is not recommended for sprites. (Will not render sprite alpha transparency.)

Texture (2)

Works exactly like the Color rendering mode. To do: Does it really?

This mode is not recommended for sprites. (Will not render sprite alpha transparency.)

Look into: Is this how the texture tool in Garry's mod works?

Glow (3)

This render mode is intended for glow sprites. (It will not make entities glow in the dark - sprites will always glow in the dark.) It will of course render sprite alpha transparency correctly.

The size of a sprite rendered with Glow is consistent with the screen size (unlike World Space Glow), making it seem larger at a distance, in comparison to the world. (See picture.)

To do: Is this and World Space Glow the only ones to use the GlowProxySize keyvalue of sprites?

This rendering mode could be used to discreetly make the player notice something, like for instance a specific glowing button at a console.

Solid (4)

This rendering mode is also referred to as Alphatest.

Alphatesting is the process of comparing each pixel of the texture(s), rendering pixels of a certain shade of blue (seen in debug/debugluxels) as transparent.

This is very useful for rendering see-through grates, bars and fences, that would otherwise require a complex and detailed brushwork to accomplish, using just a single texture.

To do: Picture: A texture previously used for Solid, with its blue parts visible, compared to the same grate in-game.

While this rendering mode was required to alphatest textures in Goldsource, alphatesting is now (in Source) handled automatically by materials, making this rendering mode obsolete.

There´s one use, though, for this. With entities that don´t allow the disable input. They can be set to this render mode (instead of normal) and toggle their visibility by the alpha output, with a parameter override where 255 will be normal and 0 will be invisible. Prop_dynamic_override is one of these entities where the disable/enable inputs don´t work.

To do: Fix last paragraph´s grammar if neccesary.

This mode is not recommended for sprites. (Will not render sprite alpha transparency.)

Additive (5)

To do: This rendering mode doesn't seem to work any different than the Color mode when it comes to adding its color to its background. Is this mode for sprites only? ...like an older Goldsource version of the Glow rendering mode?

This mode will render sprite alpha transparency correctly, making it one of the few rendering modes for sprites. However, as it still tests the Z buffer, rendering sprites as thin layers that will penetrate any surrounding brushwork, it is not ideal for this.

Note:Rendering mode 6 does not exist. Additive Fractional Frame is rendering mode 7.

Additive Fractional Frame (7)

Blends between animation frames. To do: What does that means? Animated sprites - what? Just like the Additive mode otherwise? Write a better description.

To do: This rendering mode doesn't seem to work any different than the Color mode when it comes to adding its color to its background. Is this mode for sprites only? ...like an older Goldsource version of the Glow rendering mode?

This mode renders sprite alpha transparency correctly, making it one of the few rendering modes for sprites. To do: How does it handle surrounding brushwork? Does it handle it as poorly as the Additive mode?

Alpha Add (8)

Warning:This mode is not recommended for sprites.

This rendering mode is not in the FGD, but can be achieved through turning SmartEdit off and then giving the rendermode field the value of 8.

This rendering mode is similar to Additive, except that the alpha channel controls the opacity of the sprite, instead of the amount to glow.

One example is sprites/strider_blackball.vmt. With Additive rendering mode, the black ball will undesirably become totally transparent and invisible, since Additive means adding color to the background, and adding black color changes nothing. But Alpha Add mode will first erase the background behind the ball (where the opacity is 1.0), and then add the color of the ball and its halo into the foreground.

World Space Glow (9)

This mode renders sprite alpha transparency correctly, making it one of the few ideal rendering modes for sprites. It has no Z buffer checks, so it's much like the glow mode, except that it is rendered like it has a place in the world, it's size being relative to the world rather than the screen. (See picture.)

This effect is most useful for having lamp props (like bulbs) glow properly.

Don't Render (10)

This rendering mode is also referred to as None.

This rendering mode simply tells the renderer not to render this entity. (The player can still interact with the entity, but it will not be drawn.)

Note:The entity is still networked in this mode. To avoid transmitting this entity to clients, see EF_NODRAW.
Personal tools
Namespaces
Variants
Actions