Shaders

Shaders are programs used for the production of appropriate levels of light and color within an image, to produce special effects, or do post-processing. Shaders in Kanzi are based on the OpenGL ES 2.0 shading language.

Each material type in Kanzi comes with shaders that define the shading algorithm. The shaders consists of vertex shaders (.frag.glsl) and fragment shaders (.vert.glsl).

In Kanzi Studio, the shader programs are stored as external files. When you add shaders to the <KanziWorkspace>/Projects/<ProjectName>/Shaders directory of your Kanzi Studio project, Kanzi Studio automatically shows them in the Library > Resource Files > Shaders.

You can find shaders that ship with Kanzi in <KanziInstallation>/Studio/Asset Library/MaterialTypes:

Kanzi comes with these shaders:

The main advantages of shaders is that they are programmable and that it is easy to create your own. See Editing shaders.

In Kanzi you can also use binary shaders. Binary shaders are shader programs pre-compiled by hardware manufacturer-specific compilers before they are passed to the GPU. This allows for considerably shorter loading times. See Using binary shaders.

See also

Shaders best practices

Using binary shaders

Optimizing fragment shaders

Reducing shader switches

Editing shaders

Material types and materials