Skip to content

Shaders

Romain Milbert edited this page Mar 22, 2022 · 2 revisions

Shaders in RaZ must be written in GLSL, OpenGL's Shading Language.

Specificities

RaZ does not add specific definitions to shaders yet. Should that change, this section will be updated.

Unless you need a specific version, specifying a #version tag is unnecessary: it will automatically be added when loading the shader if missing. For example, when loading a shader with OpenGL 4.6, #version 460 will be added at the top of the shader. Likewise, with OpenGL ES 3.0, #version 300 es will be set. If this tag does exist at the beginning of your shader, it will be left as-is.

This does mean that you can write a single shader for both APIs (standard & ES), but it is your responsibility to make it compatible with the two of them: a shader compiling with standard OpenGL does not mean it is compatible with ES; the other way around seems much less common.

Clone this wiki locally