A_OverlayRenderstyle

From ZDoom Wiki
Jump to navigation Jump to search


Note: While the function described on this page is defined in the Actor class, it only works when called either from a PlayerPawn state, or from one of the StateProvider states handled by PSprite, such as Weapon's Ready/Fire/etc. state sequences or a CustomInventory's Use state sequence. It will have no effect in any other context (such as calling it from a weapon's DoEffect override). If there's a need to achieve a similar effect from a different context, obtain a pointer to the necessary PSprite and modify its fields directly.

Actor

action native void A_OverlayRenderStyle(int layer, int style)

Usage

Sets the renderstyle of the overlay specified. Requires A_OverlayFlags PSPF_RENDERSTYLE set to true to have any effect.

Parameters

  • int layer
ID of the layer to modify.
  • int style
Can be one of the following:
  • STYLE_None - Do not render
  • STYLE_Normal - Regular rendering (all pixels of the graphic are opaque)
  • STYLE_Fuzzy - With a fuzz effect, like the Spectre
  • STYLE_SoulTrans - Each pixel has the same translucency to an amount determined by the transsouls CVAR.
  • STYLE_OptFuzzy - Fuzzy or translucent, based on the value of the r_drawfuzz CVAR.
  • STYLE_Stencil - All pixels are drawn in a single color and fully opaque.
  • STYLE_Translucent - Each pixel is evenly translucent according to the alpha field (from 0.0 to 1.0).
  • STYLE_TranslucentStencil - Like STYLE_Stencil, but supports alpha.
  • STYLE_Add - Additive rendering: each pixel's color is added to the color of the underlying scene. Lighter pixels will appear more opaque and bright, while darker will appear less opaque. Creates a "glowing" effect recommended for things that are meant to emit light, like fire, plasma, etc.
  • STYLE_Shaded - Translucency is applied to each pixel based on its brightness (similar to STYLE_Add), then all pixels are tinted to a specific color. This is how decals are drawn by default.
  • STYLE_Shadow - Equivalent to black translucent stencil with an alpha of 0.3. Ignores custom alpha and color values.
  • STYLE_Subtract - The opposite of additive: the color value of each pixel is subtracted from the color of the scene, creating a dark translucency of the opposite color, e.g. a red color being subtracted from a white surface will cause a cyan "shadow".
  • STYLE_AddStencil - Combines stencil and additive: all pixels are drawn in a single color, and the whole graphic will be translucent based on the brightness of that color.
  • STYLE_AddShaded - Combines shaded and additive: all pixels are tinted with a specific color, and the translucency of each pixel is set based on the brightness of its color.
  • STYLE_Multiply - Colors of each pixel and the underlying scene are multiplied (hardware renderer only). This results in intense dark tones. Ignores custom alpha values.
  • STYLE_InverseMultiply - The background scene is inverted, then its colors are multiplied by the colors of each pixels of the graphic (hardware renderer only).
  • STYLE_ColorBlend - Each pixel's color is blended with the color of the underlying scene, and then translucency is applied to each pixel based on its color intensity (hardware renderer only). This allows for per-pixel translucency like STYLE_Add, but there's no "glowing" effect, and instead the graphic appears very faint.
  • STYLE_ColorAdd - Same as STYLE_ColorBlend, but colors are added rather than blended.
  • STYLE_Source - No blending, same as STYLE_Normal (only used internally)

Note: while shaded render styles like STYLE_Shaded are supported, it's not possible to actually pick the color for the shade since there's no analog of the SetShade function for the PSprite class. Consider A_OverlayTranslation to translate the sprite to a single color as an alternative.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.

See Also