namespace
ShadersBuiltin shaders.
Collection of shaders for easy prototyping and basic usage.
This library is built if MAGNUM_WITH_SHADERS
is enabled when building Magnum. To use this library with CMake, 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 PRIVATE Magnum::Shaders)
See Downloading and building, Usage with CMake and Builtin shaders for more information.
Classes
- struct DistanceFieldVectorDrawUniform new in Git master
- Per-draw uniform for distance field vector shaders.
-
template<UnsignedInt dimensions>class DistanceFieldVectorGL new in Git master
- Distance field vector OpenGL shader.
- struct DistanceFieldVectorMaterialUniform new in Git master
- Material uniform for distance field vector shaders.
- struct FlatDrawUniform new in Git master
- Per-draw uniform for flat shaders.
-
template<UnsignedInt dimensions>class FlatGL new in Git master
- Flat OpenGL shader.
- struct FlatMaterialUniform new in Git master
- Material uniform for flat shaders.
-
template<UnsignedInt dimensions>struct GenericGL new in Git master
- Generic OpenGL shader definition.
- struct LineDrawUniform new in Git master
- Per-draw uniform for line shaders.
-
template<UnsignedInt dimensions>class LineGL new in Git master
- Line GL shader.
- struct LineMaterialUniform new in Git master
- Material uniform for line shaders.
- struct MeshVisualizerDrawUniform2D new in Git master
- Per-draw uniform for 2D mesh visualizer shaders.
- struct MeshVisualizerDrawUniform3D new in Git master
- Per-draw uniform for 3D mesh visualizer shaders.
- class MeshVisualizerGL2D new in Git master
- 2D mesh visualization OpenGL shader
- class MeshVisualizerGL3D new in Git master
- 3D mesh visualization OpenGL shader
- struct MeshVisualizerMaterialUniform new in Git master
- Material uniform for mesh visualizer shaders.
- struct PhongDrawUniform new in Git master
- Per-draw uniform for Phong shaders.
- class PhongGL new in Git master
- Phong OpenGL shader.
- struct PhongLightUniform new in Git master
- Light parameters for Phong shaders.
- struct PhongMaterialUniform new in Git master
- Material uniform for Phong shaders.
- struct ProjectionUniform2D new in Git master
- 2D projection uniform common for all shaders
- struct ProjectionUniform3D new in Git master
- 3D projection uniform common for all shaders
- struct TextureTransformationUniform new in Git master
- Texture transformation uniform common for all shaders.
- struct TransformationProjectionUniform2D new in Git master
- Combined 2D projection and transformation uniform common for all shaders.
- struct TransformationProjectionUniform3D new in Git master
- Combined 3D projection and transformation uniform common for all shaders.
- struct TransformationUniform2D new in Git master
- 2D transformation uniform common for all shaders
- struct TransformationUniform3D new in Git master
- 3D transformation uniform common for all shaders
- struct VectorDrawUniform new in Git master
- Per-draw uniform for vector shaders.
-
template<UnsignedInt dimensions>class VectorGL new in Git master
- Vector OpenGL shader.
- struct VectorMaterialUniform new in Git master
- Material uniform for vector shaders.
-
template<UnsignedInt dimensions>class VertexColorGL new in Git master
- Vertex color OpenGL shader.
Enums
- enum class LineCapStyle: UnsignedByte { Butt, Square, Round, Triangle } new in Git master
- Line cap style.
- enum class LineJoinStyle: UnsignedByte { Miter, Bevel } new in Git master
- Line join style.
- enum class LineVertexAnnotation: UnsignedInt { Up = 1 << 0, Join = 1 << 1, Begin = 1 << 2 } new in Git master
- Line vertex annotation.
Typedefs
-
template<UnsignedInt dimensions>using DistanceFieldVector = DistanceFieldVectorGL<dimensions> deprecated in Git master
- Distance field vector OpenGL shader.
- using DistanceFieldVector2D = DistanceFieldVectorGL2D deprecated in Git master
- Two-dimensional distance field vector OpenGL shader.
- using DistanceFieldVector3D = DistanceFieldVectorGL3D deprecated in Git master
- Three-dimensional distance field vector OpenGL shader.
- using DistanceFieldVectorGL2D = DistanceFieldVectorGL<2> new in Git master
- Two-dimensional distance field vector OpenGL shader.
- using DistanceFieldVectorGL3D = DistanceFieldVectorGL<3> new in Git master
- Three-dimensional distance field vector OpenGL shader.
-
template<UnsignedInt dimensions>using Flat = FlatGL<dimensions> deprecated in Git master
- Flat OpenGL shader.
- using Flat2D = FlatGL2D deprecated in Git master
- 2D flat OpenGL shader
- using Flat3D = FlatGL3D deprecated in Git master
- 3D flat OpenGL shader
- using FlatGL2D = FlatGL<2> new in Git master
- 2D flat OpenGL shader
- using FlatGL3D = FlatGL<3> new in Git master
- 3D flat OpenGL shader
- using GenericGL2D = GenericGL<2> new in Git master
- Generic 2D OpenGL shader definition.
- using GenericGL3D = GenericGL<3> new in Git master
- Generic 3D OpenGL shader definition.
-
template<UnsignedInt dimensions>using Generic = GenericGL<dimensions> deprecated in Git master
- Generic OpenGL shader definition.
- using Generic2D = GenericGL2D deprecated in Git master
- Generic 2D OpenGL shader definition.
- using Generic3D = GenericGL3D deprecated in Git master
- Generic 3D OpenGL shader definition.
-
using LineVertexAnnotations = Containers::
EnumSet<LineVertexAnnotation> new in Git master - Line vertex annotations.
- using LineGL2D = LineGL<2> new in Git master
- 2D line OpenGL shader
- using LineGL3D = LineGL<3> new in Git master
- 3D LineGL OpenGL shader
- using MeshVisualizer2D = MeshVisualizerGL2D deprecated in Git master
- 2D mesh visualization OpenGL shader
- using MeshVisualizer3D = MeshVisualizerGL3D deprecated in Git master
- 3D mesh visualization OpenGL shader
- using MeshVisualizer = MeshVisualizerGL3D deprecated in 2020.06
- 3D mesh visualization OpenGL shader
- using Phong = PhongGL deprecated in Git master
- Phong OpenGL shader.
-
template<UnsignedInt dimensions>using Vector = VectorGL<dimensions> deprecated in Git master
- Vector OpenGL shader.
- using Vector2D = VectorGL2D deprecated in Git master
- Two-dimensional vector OpenGL shader.
- using Vector3D = VectorGL3D deprecated in Git master
- Three-dimensional vector OpenGL shader.
- using VectorGL2D = VectorGL<2> new in Git master
- Two-dimensional vector OpenGL shader.
- using VectorGL3D = VectorGL<3> new in Git master
- Three-dimensional vector OpenGL shader.
-
template<UnsignedInt dimensions>using VertexColor = VertexColorGL<dimensions> deprecated in Git master
- Vertex color OpenGL shader.
- using VertexColor2D = VertexColorGL2D deprecated in Git master
- 2D vertex color OpenGL shader
- using VertexColor3D = VertexColorGL3D deprecated in Git master
- 3D vertex color OpenGL shader
- using VertexColorGL2D = VertexColorGL<2> new in Git master
- 2D vertex color OpenGL shader
- using VertexColorGL3D = VertexColorGL<3> new in Git master
- 3D vertex color OpenGL shader
Functions
-
template<UnsignedInt dimensions>auto operator<<(Debug& debug, DistanceFieldVectorGL<dimensions>::Flag value) -> Debug&
- Debug output operator.
-
template<UnsignedInt dimensions>auto operator<<(Debug& debug, DistanceFieldVectorGL<dimensions>::Flags value) -> Debug&
- Debug output operator.
-
template<UnsignedInt dimensions>auto operator<<(Debug& debug, FlatGL<dimensions>::Flag value) -> Debug&
- Debug output operator.
-
template<UnsignedInt dimensions>auto operator<<(Debug& debug, FlatGL<dimensions>::Flags value) -> Debug&
- Debug output operator.
- auto operator<<(Debug& debug, LineCapStyle value) -> Debug& new in Git master
- Debug output operator.
- auto operator<<(Debug& debug, LineJoinStyle value) -> Debug& new in Git master
- Debug output operator.
- auto operator<<(Debug& debug, LineVertexAnnotation value) -> Debug& new in Git master
- Debug output operator.
- auto operator<<(Debug& debug, LineVertexAnnotations value) -> Debug& new in Git master
- Debug output operator.
-
template<UnsignedInt dimensions>auto operator<<(Debug& debug, LineGL<dimensions>::Flag value) -> Debug& new in Git master
- Debug output operator.
-
template<UnsignedInt dimensions>auto operator<<(Debug& debug, LineGL<dimensions>::Flags value) -> Debug& new in Git master
- Debug output operator.
-
auto operator<<(Debug& debug,
MeshVisualizerGL2D::
Flag value) -> Debug& - Debug output operator.
-
auto operator<<(Debug& debug,
MeshVisualizerGL3D::
Flag value) -> Debug& - Debug output operator.
-
auto operator<<(Debug& debug,
MeshVisualizerGL2D::
Flags value) -> Debug& - Debug output operator.
-
auto operator<<(Debug& debug,
PhongGL::
Flag value) -> Debug& - Debug output operator.
-
template<UnsignedInt dimensions>auto operator<<(Debug& debug, VectorGL<dimensions>::Flag value) -> Debug&
- Debug output operator.
-
template<UnsignedInt dimensions>auto operator<<(Debug& debug, VectorGL<dimensions>::Flags value) -> Debug&
- Debug output operator.
-
template<UnsignedInt dimensions>auto operator<<(Debug& debug, VertexColorGL<dimensions>::Flag value) -> Debug&
- Debug output operator.
-
template<UnsignedInt dimensions>auto operator<<(Debug& debug, VertexColorGL<dimensions>::Flags value) -> Debug&
- Debug output operator.
Enum documentation
enum class Magnum:: Shaders:: LineCapStyle: UnsignedByte new in Git master
#include <Magnum/Shaders/Line.h>
Line cap style.
Enumerators | |
---|---|
Butt |
Butt cap. The line is cut off right at the endpoint. Lines of zero length will be invisible. |
Square |
Square cap. The line is extended by half of its width past the endpoint. Lines of zero length will be shown as squares. |
Round |
Round cap. The line is extended by half of its width past the endpoint. It's still rendered as a quad but pixels outside of the half-circle have the background color. Lines of zero length will be shown as circles. |
Triangle |
Triangle cap. The line is extended by half of its width past the endpoint. It's still rendered as a quad but pixels outside of the triangle have the background color. Lines of zero length will be shown as squares rotated by 45°. |
enum class Magnum:: Shaders:: LineJoinStyle: UnsignedByte new in Git master
#include <Magnum/Shaders/Line.h>
Line join style.
Enumerators | |
---|---|
Miter |
Miter join. The outer edges of both line segments extend until they intersect. In this style, the points |
Bevel |
Bevel join. Outer edges of both line segments are cut off at a right angle at their endpoints. The area between points |
enum class Magnum:: Shaders:: LineVertexAnnotation: UnsignedInt new in Git master
#include <Magnum/Shaders/Line.h>
Line vertex annotation.
A line segment drawn by the LineGL shader consists of four vertices, first two having the LineGL::
In the above diagram, there's a line strip consisting of three line segments and six pairs of points, with green and white forming (square) line caps, while azure, red form a miter line join, and blue and yellow form a bevel join. The twelve corresponding annotations, forming three quads (and one extra triangle for the bevel), are shown with U
, J
and B
letters, color-coded to show which original line point they correspond to. Line cap style and join style isn't a part of the annotation, it's set with LineCapStyle and LineJoinStyle at shader compilation time instead.
The type is 32-bit in order to match the default type of the LineGL::
Enumerators | |
---|---|
Up |
The point extends upwards assuming a left-to-right direction of the line segment. If not set, it extends downwards. Visualized as |
Join |
The point is forming a join with a neighboring line segment defined by either LineGL:: |
Begin |
The point is forming the beginning of the line segment, i.e. LineGL:: If LineVertexAnnotation:: |
Typedef documentation
template<UnsignedInt dimensions>
using Magnum:: Shaders:: DistanceFieldVector = DistanceFieldVectorGL<dimensions>
Distance field vector OpenGL shader.
typedef DistanceFieldVectorGL2D Magnum:: Shaders:: DistanceFieldVector2D
Two-dimensional distance field vector OpenGL shader.
typedef DistanceFieldVectorGL3D Magnum:: Shaders:: DistanceFieldVector3D
Three-dimensional distance field vector OpenGL shader.
typedef DistanceFieldVectorGL<2> Magnum:: Shaders:: DistanceFieldVectorGL2D new in Git master
Two-dimensional distance field vector OpenGL shader.
typedef DistanceFieldVectorGL<3> Magnum:: Shaders:: DistanceFieldVectorGL3D new in Git master
Three-dimensional distance field vector OpenGL shader.
#include <Magnum/Shaders/Flat.h>
template<UnsignedInt dimensions>
using Magnum:: Shaders:: Flat = FlatGL<dimensions>
Flat OpenGL shader.
typedef FlatGL2D Magnum:: Shaders:: Flat2D
#include <Magnum/Shaders/Flat.h>
2D flat OpenGL shader
typedef FlatGL3D Magnum:: Shaders:: Flat3D
#include <Magnum/Shaders/Flat.h>
3D flat OpenGL shader
typedef FlatGL<2> Magnum:: Shaders:: FlatGL2D new in Git master
#include <Magnum/Shaders/FlatGL.h>
2D flat OpenGL shader
typedef FlatGL<3> Magnum:: Shaders:: FlatGL3D new in Git master
#include <Magnum/Shaders/FlatGL.h>
3D flat OpenGL shader
typedef GenericGL<2> Magnum:: Shaders:: GenericGL2D new in Git master
#include <Magnum/Shaders/GenericGL.h>
Generic 2D OpenGL shader definition.
typedef GenericGL<3> Magnum:: Shaders:: GenericGL3D new in Git master
#include <Magnum/Shaders/GenericGL.h>
Generic 3D OpenGL shader definition.
#include <Magnum/Shaders/GenericGL.h>
template<UnsignedInt dimensions>
using Magnum:: Shaders:: Generic = GenericGL<dimensions>
Generic OpenGL shader definition.
typedef GenericGL2D Magnum:: Shaders:: Generic2D
#include <Magnum/Shaders/GenericGL.h>
Generic 2D OpenGL shader definition.
typedef GenericGL3D Magnum:: Shaders:: Generic3D
#include <Magnum/Shaders/GenericGL.h>
Generic 3D OpenGL shader definition.
typedef Containers:: EnumSet<LineVertexAnnotation> Magnum:: Shaders:: LineVertexAnnotations new in Git master
#include <Magnum/Shaders/Line.h>
Line vertex annotations.
Contents of the LineGL::
typedef LineGL<2> Magnum:: Shaders:: LineGL2D new in Git master
#include <Magnum/Shaders/LineGL.h>
2D line OpenGL shader
typedef LineGL<3> Magnum:: Shaders:: LineGL3D new in Git master
#include <Magnum/Shaders/LineGL.h>
3D LineGL OpenGL shader
typedef MeshVisualizerGL2D Magnum:: Shaders:: MeshVisualizer2D
#include <Magnum/Shaders/MeshVisualizer.h>
2D mesh visualization OpenGL shader
typedef MeshVisualizerGL3D Magnum:: Shaders:: MeshVisualizer3D
#include <Magnum/Shaders/MeshVisualizer.h>
3D mesh visualization OpenGL shader
typedef MeshVisualizerGL3D Magnum:: Shaders:: MeshVisualizer
#include <Magnum/Shaders/MeshVisualizer.h>
3D mesh visualization OpenGL shader
typedef PhongGL Magnum:: Shaders:: Phong
#include <Magnum/Shaders/Phong.h>
Phong OpenGL shader.
#include <Magnum/Shaders/Vector.h>
template<UnsignedInt dimensions>
using Magnum:: Shaders:: Vector = VectorGL<dimensions>
Vector OpenGL shader.
typedef VectorGL2D Magnum:: Shaders:: Vector2D
#include <Magnum/Shaders/Vector.h>
Two-dimensional vector OpenGL shader.
typedef VectorGL3D Magnum:: Shaders:: Vector3D
#include <Magnum/Shaders/Vector.h>
Three-dimensional vector OpenGL shader.
typedef VectorGL<2> Magnum:: Shaders:: VectorGL2D new in Git master
#include <Magnum/Shaders/VectorGL.h>
Two-dimensional vector OpenGL shader.
typedef VectorGL<3> Magnum:: Shaders:: VectorGL3D new in Git master
#include <Magnum/Shaders/VectorGL.h>
Three-dimensional vector OpenGL shader.
#include <Magnum/Shaders/VertexColor.h>
template<UnsignedInt dimensions>
using Magnum:: Shaders:: VertexColor = VertexColorGL<dimensions>
Vertex color OpenGL shader.
typedef VertexColorGL2D Magnum:: Shaders:: VertexColor2D
#include <Magnum/Shaders/VertexColor.h>
2D vertex color OpenGL shader
typedef VertexColorGL3D Magnum:: Shaders:: VertexColor3D
#include <Magnum/Shaders/VertexColor.h>
3D vertex color OpenGL shader
typedef VertexColorGL<2> Magnum:: Shaders:: VertexColorGL2D new in Git master
#include <Magnum/Shaders/VertexColorGL.h>
2D vertex color OpenGL shader
typedef VertexColorGL<3> Magnum:: Shaders:: VertexColorGL3D new in Git master
#include <Magnum/Shaders/VertexColorGL.h>
3D vertex color OpenGL shader
Function documentation
template<UnsignedInt dimensions>
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
DistanceFieldVectorGL<dimensions>::Flag value)
Debug output operator.
template<UnsignedInt dimensions>
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
DistanceFieldVectorGL<dimensions>::Flags value)
Debug output operator.
#include <Magnum/Shaders/FlatGL.h>
template<UnsignedInt dimensions>
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
FlatGL<dimensions>::Flag value)
Debug output operator.
#include <Magnum/Shaders/FlatGL.h>
template<UnsignedInt dimensions>
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
FlatGL<dimensions>::Flags value)
Debug output operator.
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
LineCapStyle value) new in Git master
#include <Magnum/Shaders/Line.h>
Debug output operator.
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
LineJoinStyle value) new in Git master
#include <Magnum/Shaders/Line.h>
Debug output operator.
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
LineVertexAnnotation value) new in Git master
#include <Magnum/Shaders/Line.h>
Debug output operator.
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
LineVertexAnnotations value) new in Git master
#include <Magnum/Shaders/Line.h>
Debug output operator.
#include <Magnum/Shaders/LineGL.h>
template<UnsignedInt dimensions>
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
LineGL<dimensions>::Flag value) new in Git master
Debug output operator.
#include <Magnum/Shaders/LineGL.h>
template<UnsignedInt dimensions>
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
LineGL<dimensions>::Flags value) new in Git master
Debug output operator.
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
MeshVisualizerGL2D:: Flag value)
#include <Magnum/Shaders/MeshVisualizerGL.h>
Debug output operator.
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
MeshVisualizerGL3D:: Flag value)
#include <Magnum/Shaders/MeshVisualizerGL.h>
Debug output operator.
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
MeshVisualizerGL2D:: Flags value)
#include <Magnum/Shaders/MeshVisualizerGL.h>
Debug output operator.
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
PhongGL:: Flag value)
#include <Magnum/Shaders/PhongGL.h>
Debug output operator.
#include <Magnum/Shaders/VectorGL.h>
template<UnsignedInt dimensions>
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
VectorGL<dimensions>::Flag value)
Debug output operator.
#include <Magnum/Shaders/VectorGL.h>
template<UnsignedInt dimensions>
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
VectorGL<dimensions>::Flags value)
Debug output operator.
#include <Magnum/Shaders/VertexColorGL.h>
template<UnsignedInt dimensions>
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
VertexColorGL<dimensions>::Flag value)
Debug output operator.
#include <Magnum/Shaders/VertexColorGL.h>
template<UnsignedInt dimensions>
Debug& Magnum:: Shaders:: operator<<(Debug& debug,
VertexColorGL<dimensions>::Flags value)
Debug output operator.