Effects and shaders

custom shaders, create Effects from them, and use them for drawing. The EffectSystem class provides an easy way to load an effect.

Load an effect

Use:

  1. var myEffect = EffectSystem.LoadEffect("MyEffect").WaitForResult();

pipeline state. bind resources before drawing.

Shaders

Xenko’s shading language, which is an extension of HLSL. They provide true composition of modular shaders via inheritance, shader mixins and automatic weaving of shader in-out attributes.

Effects

Effects in Xenko use C#-like syntax to further combine shaders. They provide conditional composition of shaders to generate effect permutations. .xkeffectlog) are used to enumerate all permutations ahead of time.

Target everything

GLSL for OpenGL, or SPIR-V for Vulkan platforms. For mobile platforms, shaders are optimized by a GLSL optimizer to improve performance.

In this section

  • Effect language
  • Shading language
  • Shader classes, mixins and inheritance
  • Composition
  • Compile shaders
  • Templates
  • Shader stage input/output automatic management
  • Custom shaders