Difference between revisions of "Render Modes"

From Valve Developer Community
Jump to: navigation, search
(Solid)
(Added Render Mode 6, its useless)
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
These are all the rendering modes present in [[Source]].
 
These are all the rendering modes present in [[Source]].
  
== General functionality in Source ==
+
== Description ==
 
[[Image:RenderModes Additive WSGlow comparison.jpg|thumb|250px|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.]]
 
[[Image:RenderModes Additive WSGlow comparison.jpg|thumb|250px|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:
+
In [[Source]] ''Render Mode'' keyvalue controls how an entity's appearance is drawn. Example of use is rendering a sprite properly and applying draw effects onto models.
  
# You want to render a sprite correctly (without its black box).
+
There are 4 Render Modes that render transparency correctly: ''Glow'', ''Additive'', and their alternatives ''Additive Fractional Frame'' and ''World Space Glow''. The ''Additive'' modes are rendered so that the sprite will cut through any surrounding geometry, while the two ''Glow'' modes are designed to be used for glowing sprites. Of the two Glow modes, ''Glow'' has a fixed size ''on screen'', while ''World Space Glow'' has a fixed size ''in the world''.
# You want to make an entity transparent.
 
# 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 [[:Image:RenderModes Glow WSGlow comparison.jpg|visually]].
+
[[Image:RenderModes_Glow_WSGlow_comparison.jpg|thumb|250px|A comparison of the Glow (above) and World Space Glow (below) rendering modes, for sprites.]]
  
* 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).
+
== Normal (0) ==
  
* 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).
+
The default Render Mode.
  
== Normal ==
+
Transparency keyvalues/inputs will have no effect on entities rendered with this mode.
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.
+
== Color (1) ==
  
This mode is not recommended for sprites. (Will not render sprite alpha transparency.)
+
Behaves like the Normal Render Mode, but allows transparency.
  
== Color ==
+
== Texture (2) ==
{{TODO|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.)
+
{{TODO|Same as Color, what is the exact purpose?}}
  
== Texture ==
+
== Glow (3) ==
Works exactly like the ''Color'' rendering mode. {{TODO|Does it really?}}
+
Intended for glowing sprites. Allows transparency, and forces the sprite or model to be rendered unlit.
  
This mode is not recommended for sprites. (Will not render sprite alpha transparency.)
+
The size of a sprite rendered with Glow is consistent with the screen size (unlike the alternative World Space Glow), making it appear larger at a distance, in comparison to the world.
  
Look into: Is this how the texture tool in Garry's mod works?
+
The ''GlowProxySize'' keyvalue affects this Render Mode on sprites.
  
== Glow ==
+
== Solid (4) ==
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.
+
Enables [[$alphatest|Alphatest]]ing. Legacy port from [[Goldsource]]. Obsolete in Source due to Alphatesting being handled in materials. Does not allow transparency.
  
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 [[:Image:RenderModes Glow WSGlow comparison.jpg|picture]].)
+
== Additive (5) ==
  
{{TODO|Is this and ''World Space Glow'' the only ones to use the ''GlowProxySize'' keyvalue of sprites?}}
+
Add the material's color values to the existing image, instead of performing a multiplication. Sprites will appear through world geometry and the sprite/model will always brighten the world. Allows transparency.
  
This rendering mode could be used to discreetly make the player notice something, like for instance a specific glowing button at a console.
+
== Environmental (6) ==
 +
{{not in FGD}}
  
== Solid ==
+
Causes the material to be not be drawn at all, similarly to Don't Render.
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 <code>debug/debugluxels</code>) as transparent.
+
== Additive Fractional Frame (7) ==
 +
Functions like Additive, but also blends between animation frames. Requires the material to have a functioning animating texture. Allows transparency.
  
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.
+
== Alpha Add (8) ==
 +
{{not in FGD}}
  
{{TODO|Picture: A texture previously used for Solid, with its blue parts visible, compared to the same grate in-game.}}
+
Functions similarly to ''Additive'', except that the alpha channel controls the opacity of the sprite.
 +
An example of use is for dark sprites, with an example material being sprites/strider_blackball.vmt.
  
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.
+
== World Space Glow (9) ==
 +
Functions similarly to Glow, with the exception that the size of the sprite is relative to the world rather than the screen.
  
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.
+
The ''GlowProxySize'' keyvalue affects this Render Mode on sprites.
  
This mode is not recommended for sprites. (Will not render sprite alpha transparency.)
+
== Don't Render (10) ==
 +
Also referred to as ''None''.
  
== Additive ==
+
The entity is still being drawn and networked albeit invisible, therefore not making this Render Mode ideal for performance reasons.
{{TODO|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?}}
 
  
The precise formula is: <math>...</math>(?)
+
To completely avoid drawing and networking an entity, see [[EF_NODRAW]].
 
 
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 ==
 
Blends between animation frames. {{TODO|What does that means? Animated sprites - what? Just like the ''Additive'' mode otherwise? Write a better description.}}
 
 
 
{{TODO|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. {{TODO|How does it handle surrounding brushwork? Does it handle it as poorly as the ''Additive'' mode?}}
 
 
 
== Alpha add ==
 
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 <code>8</code>.
 
 
 
{{TODO|Write description. It doesn't seem to differ from the ''Color'' mode though.}}
 
 
 
This mode is not recommended for sprites. (Will not render sprite alpha transparency.)
 
 
 
== World space glow ==
 
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|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 [[:Image:RenderModes Glow WSGlow comparison.jpg|picture]].)
 
 
 
This effect is most useful for having lamp props (like bulbs) glow properly.
 
 
 
== Don't render ==
 
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]].}}
 
  
 
[[Category:Technical]]
 
[[Category:Technical]]

Latest revision as of 22:09, 29 December 2018

These are all the rendering modes present in Source.

Description

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 Render Mode keyvalue controls how an entity's appearance is drawn. Example of use is rendering a sprite properly and applying draw effects onto models.

There are 4 Render Modes that render transparency correctly: Glow, Additive, and their alternatives Additive Fractional Frame and World Space Glow. The Additive modes are rendered so that the sprite will cut through any surrounding geometry, while the two Glow modes are designed to be used for glowing sprites. Of the two Glow modes, Glow has a fixed size on screen, while World Space Glow has a fixed size in the world.

A comparison of the Glow (above) and World Space Glow (below) rendering modes, for sprites.

Normal (0)

The default Render Mode.

Transparency keyvalues/inputs will have no effect on entities rendered with this mode.

Color (1)

Behaves like the Normal Render Mode, but allows transparency.

Texture (2)

To do: Same as Color, what is the exact purpose?

Glow (3)

Intended for glowing sprites. Allows transparency, and forces the sprite or model to be rendered unlit.

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

The GlowProxySize keyvalue affects this Render Mode on sprites.

Solid (4)

Enables Alphatesting. Legacy port from Goldsource. Obsolete in Source due to Alphatesting being handled in materials. Does not allow transparency.

Additive (5)

Add the material's color values to the existing image, instead of performing a multiplication. Sprites will appear through world geometry and the sprite/model will always brighten the world. Allows transparency.

Environmental (6)

!FGD

Causes the material to be not be drawn at all, similarly to Don't Render.

Additive Fractional Frame (7)

Functions like Additive, but also blends between animation frames. Requires the material to have a functioning animating texture. Allows transparency.

Alpha Add (8)

!FGD

Functions similarly to Additive, except that the alpha channel controls the opacity of the sprite. An example of use is for dark sprites, with an example material being sprites/strider_blackball.vmt.

World Space Glow (9)

Functions similarly to Glow, with the exception that the size of the sprite is relative to the world rather than the screen.

The GlowProxySize keyvalue affects this Render Mode on sprites.

Don't Render (10)

Also referred to as None.

The entity is still being drawn and networked albeit invisible, therefore not making this Render Mode ideal for performance reasons.

To completely avoid drawing and networking an entity, see EF_NODRAW.