Xenko

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • Manual
  • API
  • Release notes
    Show / Hide Table of Contents

    Effects and shaders

    Xenko uses a programmable shading pipeline. You can write custom shaders, create @'SiliconStudio.Xenko.Graphics.Effect's from them, and use them for drawing. The @'SiliconStudio.Xenko.Rendering.EffectSystem' class provides an easy way to load an effect.

    Load an effect

    Use:

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

    You can then bind the effect as pipeline state.

    An effect also often defines a set of parameters. To set these, you need to bind resources before drawing.

    Shaders

    Shaders are authored in the 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.

    As some platforms can't compile shaders at runtime (eg iOS, Android, etc), effect permutation files (.xkeffectlog) are used to enumerate all permutations ahead of time.

    Target everything

    Xenko shaders are converted automatically to the target graphics platform - either plain HLSL for Direct3D, 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
      • Templates
      • Shader stage input/output automatic management
    • Custom shaders
    • Improve this Doc

    Back to top

    Copyright © 2016 Silicon Studio
    Generated by DocFX