Shaders

From ZDoom Wiki
Jump to navigation Jump to search

GZDoom supports pixel shaders in the form of material shaders and post-processing shaders. Material shaders can be applied to a specific graphic (which can be used as a sprite, texture, and so on) and affect it all the time while it's being drawn. Post-processing shaders affect the whole viewport and can be manually enabled and disabled with ZScript. Shaders can be used to dynamically alter the graphic or the whole image. A common example of a material shader is the ANIMDEFS warp shaders that are often applied to liquid textures. Post-processing shaders are used for effects like blur, vignette, hue and color alternation, and such.

Usage

Author can place their custom shaders under the /shaders/ directory in their project's PK3 file. To function in the game, shaders must be added via GLDEFS:

  • Material shaders can be applied to images either via the HardwareShader or the Material blocks in GLDEFS. The latter method is more robust and convenient, so it's recommended. It's described here.
  • Post-processing (screenspace) shaders can be applied via the HardwareShader block, as described here.

See also