This is a snapshot of a work-in-progress documentation theme. If you feel lost, miss something, or want to see the original Doxygen docs instead, head over to the archived version of this documentation page.

Magnum::Shaders namespace

Builtin shaders.


Collection of shaders for easy prototyping and basic usage.

This library is built if WITH_SHADERS is enabled when building Magnum. To use this library with CMake, you need to request the Shaders component of the Magnum package and link to the Magnum::Shaders target:

find_package(Magnum REQUIRED Shaders)

# ...
target_link_libraries(your-app Magnum::Shaders)

See Downloading and building, Usage with CMake and Builtin shaders for more information.


template<UnsignedInt dimensions>
class AbstractVector
Base for vector shaders.
template<UnsignedInt dimensions>
class DistanceFieldVector
Distance field vector shader.
template<UnsignedInt dimensions>
class Flat
Flat shader.
template<UnsignedInt dimensions>
struct Generic
Generic shader definition.
class MeshVisualizer
Mesh visualization shader.
class Phong
Phong shader.
template<UnsignedInt dimensions>
class Vector
Vector shader.
template<UnsignedInt dimensions>
class VertexColor
Vertex color shader.


using AbstractVector2D = AbstractVector<2>
Base for two-dimensional text shaders.
using AbstractVector3D = AbstractVector<3>
Base for three-dimensional text shader.
using DistanceFieldVector2D = DistanceFieldVector<2>
Two-dimensional distance field vector shader.
using DistanceFieldVector3D = DistanceFieldVector<3>
Three-dimensional distance field vector shader.
using Flat2D = Flat<2>
2D flat shader
using Flat3D = Flat<3>
3D flat shader
using Generic2D = Generic<2>
Generic 2D shader definition.
using Generic3D = Generic<3>
Generic 3D shader definition.
using Vector2D = Vector<2>
Two-dimensional vector shader.
using Vector3D = Vector<3>
Three-dimensional vector shader.
using VertexColor2D = VertexColor<2>
2D vertex color shader
using VertexColor3D = VertexColor<3>
3D vertex color shader