Browse Source

Shaders: doc++

pull/601/head
Vladimír Vondruš 3 years ago
parent
commit
963faea23d
  1. 19
      src/Magnum/Shaders/DistanceFieldVectorGL.h
  2. 70
      src/Magnum/Shaders/FlatGL.h
  3. 134
      src/Magnum/Shaders/MeshVisualizerGL.h
  4. 75
      src/Magnum/Shaders/PhongGL.h
  5. 19
      src/Magnum/Shaders/VectorGL.h
  6. 25
      src/Magnum/Shaders/VertexColorGL.h

19
src/Magnum/Shaders/DistanceFieldVectorGL.h

@ -134,8 +134,8 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT DistanceFieldVector
* @brief Vertex position * @brief Vertex position
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector2 "Vector2" in 2D, @ref Magnum::Vector3 "Vector3" * @relativeref{Magnum,Vector2} in 2D, @relativeref{Magnum,Vector3} in
* in 3D. * 3D.
*/ */
typedef typename GenericGL<dimensions>::Position Position; typedef typename GenericGL<dimensions>::Position Position;
@ -143,7 +143,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT DistanceFieldVector
* @brief 2D texture coordinates * @brief 2D texture coordinates
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector2 "Vector2". * @relativeref{Magnum,Vector2}.
*/ */
typedef typename GenericGL<dimensions>::TextureCoordinates TextureCoordinates; typedef typename GenericGL<dimensions>::TextureCoordinates TextureCoordinates;
@ -191,11 +191,12 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT DistanceFieldVector
* and adds the value from @ref setDrawOffset() with the * and adds the value from @ref setDrawOffset() with the
* @glsl gl_DrawID @ce builtin, which makes draws submitted via * @glsl gl_DrawID @ce builtin, which makes draws submitted via
* @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&) * @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&)
* pick up per-draw parameters directly, without having to rebind * and related APIs pick up per-draw parameters directly, without
* the uniform buffers or specify @ref setDrawOffset() before each * having to rebind the uniform buffers or specify
* draw. In a non-multidraw scenario, @glsl gl_DrawID @ce is * @ref setDrawOffset() before each draw. In a non-multidraw
* @cpp 0 @ce, which means a shader with this flag enabled can be * scenario, @glsl gl_DrawID @ce is @cpp 0 @ce, which means a
* used for regular draws as well. * shader with this flag enabled can be used for regular draws as
* well.
* @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object} * @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object}
* and @gl_extension{ARB,shader_draw_parameters} * and @gl_extension{ARB,shader_draw_parameters}
* @requires_es_extension OpenGL ES 3.0 and extension * @requires_es_extension OpenGL ES 3.0 and extension
@ -217,7 +218,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT DistanceFieldVector
* @brief Flags * @brief Flags
* @m_since{2020,06} * @m_since{2020,06}
* *
* @see @ref flags() * @see @ref flags(), @ref Configuration::setFlags()
*/ */
typedef Containers::EnumSet<Flag> Flags; typedef Containers::EnumSet<Flag> Flags;
#else #else

70
src/Magnum/Shaders/FlatGL.h

@ -263,8 +263,8 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @brief Vertex position * @brief Vertex position
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector2 "Vector2" in 2D, @ref Magnum::Vector3 "Vector3" * @relativeref{Magnum,Vector2} in 2D, @relativeref{Magnum,Vector3} in
* in 3D. * 3D.
*/ */
typedef typename GenericGL<dimensions>::Position Position; typedef typename GenericGL<dimensions>::Position Position;
@ -272,7 +272,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @brief 2D texture coordinates * @brief 2D texture coordinates
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector2 "Vector2". Used only if @ref Flag::Textured is * @relativeref{Magnum,Vector2}. Used only if @ref Flag::Textured is
* set. * set.
*/ */
typedef typename GenericGL<dimensions>::TextureCoordinates TextureCoordinates; typedef typename GenericGL<dimensions>::TextureCoordinates TextureCoordinates;
@ -302,8 +302,9 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @brief Joint ids * @brief Joint ids
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4ui. * @ref shaders-generic "Generic attribute",
* Used only if @ref perVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4ui}. Used only if
* @ref perVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -316,8 +317,9 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @brief Weights * @brief Weights
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4. * @ref shaders-generic "Generic attribute",
* Used only if @ref perVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4}. Used only if
* @ref perVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -330,8 +332,9 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @brief Secondary joint ids * @brief Secondary joint ids
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4ui. * @ref shaders-generic "Generic attribute",
* Used only if @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4ui}. Used only if
* @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -344,8 +347,9 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @brief Secondary weights * @brief Secondary weights
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4. * @ref shaders-generic "Generic attribute",
* Used only if @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4}. Used only if
* @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -360,8 +364,9 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @brief (Instanced) object ID * @brief (Instanced) object ID
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::UnsignedInt. * @ref shaders-generic "Generic attribute",
* Used only if @ref Flag::InstancedObjectId is set. * @relativeref{Magnum,UnsignedInt}. Used only if
* @ref Flag::InstancedObjectId is set.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Object ID output requires integer support in * @requires_gles30 Object ID output requires integer support in
* shaders, which is not available in OpenGL ES 2.0. * shaders, which is not available in OpenGL ES 2.0.
@ -375,9 +380,9 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @brief (Instanced) transformation matrix * @brief (Instanced) transformation matrix
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Matrix3 in * @ref shaders-generic "Generic attribute",
* 2D, @ref Magnum::Matrix4 in 3D. Used only if * @relativeref{Magnum,Matrix3} in 2D, @relativeref{Magnum,Matrix4} in
* @ref Flag::InstancedTransformation is set. * 3D. Used only if @ref Flag::InstancedTransformation is set.
* @requires_gl33 Extension @gl_extension{ARB,instanced_arrays} * @requires_gl33 Extension @gl_extension{ARB,instanced_arrays}
* @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays}, * @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays},
* @gl_extension{EXT,instanced_arrays} or * @gl_extension{EXT,instanced_arrays} or
@ -391,8 +396,9 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @brief (Instanced) texture offset * @brief (Instanced) texture offset
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector2. Use * @ref shaders-generic "Generic attribute",
* either this or the @ref TextureOffsetLayer attribute. Used only if * @relativeref{Magnum,Vector2}. Use either this or the
* @ref TextureOffsetLayer attribute. Used only if
* @ref Flag::InstancedTextureOffset is set. * @ref Flag::InstancedTextureOffset is set.
* @requires_gl33 Extension @gl_extension{ARB,instanced_arrays} * @requires_gl33 Extension @gl_extension{ARB,instanced_arrays}
* @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays}, * @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays},
@ -408,11 +414,11 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @brief (Instanced) texture offset and layer * @brief (Instanced) texture offset and layer
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector3, with * @ref shaders-generic "Generic attribute",
* the last component interpreted as an integer. Use either this or the * @relativeref{Magnum,Vector3}, with the last component interpreted as
* @ref TextureOffset attribute. First two components used only if * an integer. Use either this or the @ref TextureOffset attribute.
* @ref Flag::InstancedTextureOffset is set, third component only if * First two components used only if @ref Flag::InstancedTextureOffset
* @ref Flag::TextureArrays is set. * is set, third component only if @ref Flag::TextureArrays is set.
* @requires_gl33 Extension @gl_extension{EXT,texture_array} and * @requires_gl33 Extension @gl_extension{EXT,texture_array} and
* @gl_extension{ARB,instanced_arrays} * @gl_extension{ARB,instanced_arrays}
* @requires_gles30 Texture arrays are not available in OpenGL ES 2.0. * @requires_gles30 Texture arrays are not available in OpenGL ES 2.0.
@ -423,8 +429,9 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
enum: UnsignedInt { enum: UnsignedInt {
/** /**
* Color shader output. Present always, expects three- or * Color shader output. @ref shaders-generic "Generic output",
* four-component floating-point or normalized buffer attachment. * present always. Expects three- or four-component floating-point
* or normalized buffer attachment.
* @m_since{2019,10} * @m_since{2019,10}
*/ */
ColorOutput = GenericGL<dimensions>::ColorOutput, ColorOutput = GenericGL<dimensions>::ColorOutput,
@ -603,11 +610,12 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* and adds the value from @ref setDrawOffset() with the * and adds the value from @ref setDrawOffset() with the
* @glsl gl_DrawID @ce builtin, which makes draws submitted via * @glsl gl_DrawID @ce builtin, which makes draws submitted via
* @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&) * @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&)
* pick up per-draw parameters directly, without having to rebind * and related APIs pick up per-draw parameters directly, without
* the uniform buffers or specify @ref setDrawOffset() before each * having to rebind the uniform buffers or specify
* draw. In a non-multidraw scenario, @glsl gl_DrawID @ce is * @ref setDrawOffset() before each draw. In a non-multidraw
* @cpp 0 @ce, which means a shader with this flag enabled can be * scenario, @glsl gl_DrawID @ce is @cpp 0 @ce, which means a
* used for regular draws as well. * shader with this flag enabled can be used for regular draws as
* well.
* @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object} * @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object}
* and @gl_extension{ARB,shader_draw_parameters} * and @gl_extension{ARB,shader_draw_parameters}
* @requires_es_extension OpenGL ES 3.0 and extension * @requires_es_extension OpenGL ES 3.0 and extension
@ -669,7 +677,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
/** /**
* @brief Flags * @brief Flags
* *
* @see @ref flags() * @see @ref flags(), @ref Configuration::setFlags()
*/ */
typedef Containers::EnumSet<Flag> Flags; typedef Containers::EnumSet<Flag> Flags;
#else #else

134
src/Magnum/Shaders/MeshVisualizerGL.h

@ -216,7 +216,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D: public Implementation::MeshVisua
* @brief Vertex position * @brief Vertex position
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector2 "Vector2". * @relativeref{Magnum,Vector2}.
*/ */
typedef typename GenericGL2D::Position Position; typedef typename GenericGL2D::Position Position;
@ -230,7 +230,8 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D: public Implementation::MeshVisua
* @brief Joint ids * @brief Joint ids
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4ui. * @ref shaders-generic "Generic attribute",
* @relativeref{Magnum,Vector4ui}.
* Used only if @ref perVertexJointCount() isn't @cpp 0 @ce. * Used only if @ref perVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
@ -244,8 +245,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D: public Implementation::MeshVisua
* @brief Weights * @brief Weights
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4. * @ref shaders-generic "Generic attribute",
* Used only if @ref perVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4}. Used only if
* @ref perVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -258,8 +260,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D: public Implementation::MeshVisua
* @brief Secondary joint ids * @brief Secondary joint ids
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4ui. * @ref shaders-generic "Generic attribute",
* Used only if @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4ui}. Used only if
* @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -272,8 +275,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D: public Implementation::MeshVisua
* @brief Secondary weights * @brief Secondary weights
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4. * @ref shaders-generic "Generic attribute",
* Used only if @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4}. Used only if
* @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -283,11 +287,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D: public Implementation::MeshVisua
typedef GenericGL3D::SecondaryWeights SecondaryWeights; typedef GenericGL3D::SecondaryWeights SecondaryWeights;
#endif #endif
/** /** @copydoc MeshVisualizerGL3D::VertexIndex */
* @brief Vertex index
*
* See @ref MeshVisualizerGL3D::VertexIndex for more information.
*/
typedef GL::Attribute<4, Float> VertexIndex; typedef GL::Attribute<4, Float> VertexIndex;
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
@ -295,8 +295,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D: public Implementation::MeshVisua
* @brief (Instanced) object ID * @brief (Instanced) object ID
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::UnsignedInt. * @ref shaders-generic "Generic attribute",
* Used only if @ref Flag::InstancedObjectId is set. * @relativeref{Magnum,UnsignedInt}. Used only if
* @ref Flag::InstancedObjectId is set.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Object ID output requires integer support in * @requires_gles30 Object ID output requires integer support in
* shaders, which is not available in OpenGL ES 2.0. * shaders, which is not available in OpenGL ES 2.0.
@ -310,8 +311,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D: public Implementation::MeshVisua
* @brief (Instanced) transformation matrix * @brief (Instanced) transformation matrix
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Matrix3. * @ref shaders-generic "Generic attribute",
* Used only if @ref Flag::InstancedTransformation is set. * @relativeref{Magnum,Matrix3}. Used only if
* @ref Flag::InstancedTransformation is set.
* @requires_gl33 Extension @gl_extension{ARB,instanced_arrays} * @requires_gl33 Extension @gl_extension{ARB,instanced_arrays}
* @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays}, * @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays},
* @gl_extension{EXT,instanced_arrays} or * @gl_extension{EXT,instanced_arrays} or
@ -499,11 +501,12 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D: public Implementation::MeshVisua
* and combines the value from @ref setDrawOffset() with the * and combines the value from @ref setDrawOffset() with the
* @glsl gl_DrawID @ce builtin, which makes draws submitted via * @glsl gl_DrawID @ce builtin, which makes draws submitted via
* @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&) * @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&)
* pick up per-draw parameters directly, without having to rebind * and related APIs pick up per-draw parameters directly, without
* the uniform buffers or specify @ref setDrawOffset() before each * having to rebind the uniform buffers or specify
* draw. In a non-multidraw scenario, @glsl gl_DrawID @ce is * @ref setDrawOffset() before each draw. In a non-multidraw
* @cpp 0 @ce, which means a shader with this flag enabled can be * scenario, @glsl gl_DrawID @ce is @cpp 0 @ce, which means a
* used for regular draws as well. * shader with this flag enabled can be used for regular draws as
* well.
* @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object} * @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object}
* and @gl_extension{ARB,shader_draw_parameters} * and @gl_extension{ARB,shader_draw_parameters}
* @requires_es_extension OpenGL ES 3.0 and extension * @requires_es_extension OpenGL ES 3.0 and extension
@ -547,7 +550,11 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D: public Implementation::MeshVisua
#endif #endif
}; };
/** @brief Flags */ /**
* @brief Flags
*
* @see @ref flags(), @ref Configuration::setFlags()
*/
typedef Containers::EnumSet<Flag> Flags; typedef Containers::EnumSet<Flag> Flags;
/** /**
@ -1641,7 +1648,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @brief Vertex position * @brief Vertex position
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector3 "Vector3". * @relativeref{Magnum,Vector3}.
*/ */
typedef typename GenericGL3D::Position Position; typedef typename GenericGL3D::Position Position;
@ -1650,7 +1657,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector3 "Vector3". Use either this or the @ref Tangent4 * @relativeref{Magnum,Vector3}. Use either this or the @ref Tangent4
* attribute. Used only if @ref Flag::TangentDirection is enabled. * attribute. Used only if @ref Flag::TangentDirection is enabled.
*/ */
typedef typename GenericGL3D::Tangent Tangent; typedef typename GenericGL3D::Tangent Tangent;
@ -1660,7 +1667,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector4 "Vector4". Use either this or the @ref Tangent * @relativeref{Magnum,Vector4}. Use either this or the @ref Tangent
* attribute. Used only if @ref Flag::TangentDirection or * attribute. Used only if @ref Flag::TangentDirection or
* @ref Flag::BitangentFromTangentDirection is enabled. * @ref Flag::BitangentFromTangentDirection is enabled.
*/ */
@ -1671,7 +1678,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector3 "Vector3". Use either this or the @ref Tangent4 * @relativeref{Magnum,Vector3}. Use either this or the @ref Tangent4
* attribute. Used only if @ref Flag::BitangentDirection is enabled. * attribute. Used only if @ref Flag::BitangentDirection is enabled.
*/ */
typedef typename GenericGL3D::Bitangent Bitangent; typedef typename GenericGL3D::Bitangent Bitangent;
@ -1681,7 +1688,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector3 "Vector3". Used only if * @relativeref{Magnum,Vector3}. Used only if
* @ref Flag::NormalDirection is enabled. * @ref Flag::NormalDirection is enabled.
*/ */
typedef typename GenericGL3D::Normal Normal; typedef typename GenericGL3D::Normal Normal;
@ -1692,7 +1699,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector2 "Vector2". Used only if * @relativeref{Magnum,Vector2}. Used only if
* @ref Flag::ObjectIdTexture is enabled. * @ref Flag::ObjectIdTexture is enabled.
* @requires_gl33 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl33 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Object ID input requires integer support in * @requires_gles30 Object ID input requires integer support in
@ -1708,8 +1715,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @brief Joint ids * @brief Joint ids
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4ui. * @ref shaders-generic "Generic attribute",
* Used only if @ref perVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4ui}. Used only if
* @ref perVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -1722,8 +1730,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @brief Weights * @brief Weights
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4. * @ref shaders-generic "Generic attribute",
* Used only if @ref perVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4}. Used only if
* @ref perVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -1736,8 +1745,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @brief Secondary joint ids * @brief Secondary joint ids
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4ui. * @ref shaders-generic "Generic attribute",
* Used only if @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4ui}. Used only if
* @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -1750,8 +1760,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @brief Secondary weights * @brief Secondary weights
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4. * @ref shaders-generic "Generic attribute",
* Used only if @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4}. Used only if
* @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -1764,7 +1775,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
/** /**
* @brief Vertex index * @brief Vertex index
* *
* @ref Magnum::Float "Float", used only in OpenGL < 3.1 and OpenGL ES * @relativeref{Magnum,Float}, used only in OpenGL < 3.1 and OpenGL ES
* 2.0 if @ref Flag::Wireframe is enabled. This attribute (modulo 3) * 2.0 if @ref Flag::Wireframe is enabled. This attribute (modulo 3)
* specifies index of given vertex in triangle, i.e. @cpp 0.0f @ce for * specifies index of given vertex in triangle, i.e. @cpp 0.0f @ce for
* first, @cpp 1.0f @ce for second, @cpp 2.0f @ce for third. In OpenGL * first, @cpp 1.0f @ce for second, @cpp 2.0f @ce for third. In OpenGL
@ -1784,8 +1795,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @brief (Instanced) object ID * @brief (Instanced) object ID
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::UnsignedInt. * @ref shaders-generic "Generic attribute",
* Used only if @ref Flag::InstancedObjectId is set. * @relativeref{Magnum,UnsignedInt}. Used only if
* @ref Flag::InstancedObjectId is set.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Object ID output requires integer support in * @requires_gles30 Object ID output requires integer support in
* shaders, which is not available in OpenGL ES 2.0. * shaders, which is not available in OpenGL ES 2.0.
@ -1799,8 +1811,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @brief (Instanced) transformation matrix * @brief (Instanced) transformation matrix
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Matrix4. * @ref shaders-generic "Generic attribute",
* Used only if @ref Flag::InstancedTransformation is set. * @relativeref{Magnum,Matrix4}. Used only if
* @ref Flag::InstancedTransformation is set.
* @requires_gl33 Extension @gl_extension{ARB,instanced_arrays} * @requires_gl33 Extension @gl_extension{ARB,instanced_arrays}
* @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays}, * @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays},
* @gl_extension{EXT,instanced_arrays} or * @gl_extension{EXT,instanced_arrays} or
@ -1815,8 +1828,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @brief (Instanced) normal matrix * @brief (Instanced) normal matrix
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Matrix3x3. * @ref shaders-generic "Generic attribute",
* Used only if @ref Flag::InstancedTransformation and at least one of * @relativeref{Magnum,Matrix3x3}. Used only if
* @ref Flag::InstancedTransformation and at least one of
* @ref Flag::TangentDirection, @ref Flag::BitangentDirection or * @ref Flag::TangentDirection, @ref Flag::BitangentDirection or
* @ref Flag::NormalDirection is set. * @ref Flag::NormalDirection is set.
* @requires_gl33 Extension @gl_extension{ARB,geometry_shader4} and * @requires_gl33 Extension @gl_extension{ARB,geometry_shader4} and
@ -1834,8 +1848,9 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @brief (Instanced) texture offset for an object ID texture * @brief (Instanced) texture offset for an object ID texture
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector2. Used * @ref shaders-generic "Generic attribute",
* only if @ref Flag::InstancedTextureOffset is set. * @relativeref{Magnum,Vector2}. Used only if
* @ref Flag::InstancedTextureOffset is set.
* @requires_gl33 Extension @gl_extension{EXT,gpu_shader4} and * @requires_gl33 Extension @gl_extension{EXT,gpu_shader4} and
* @gl_extension{ARB,instanced_arrays} * @gl_extension{ARB,instanced_arrays}
* @requires_gles30 Object ID input requires integer support in * @requires_gles30 Object ID input requires integer support in
@ -1849,11 +1864,11 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* @brief (Instanced) texture offset and layer for an object ID texture * @brief (Instanced) texture offset and layer for an object ID texture
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector3, with * @ref shaders-generic "Generic attribute",
* the last component interpreted as an integer. Use either this or the * @relativeref{Magnum,Vector3}, with the last component interpreted as
* @ref TextureOffset attribute. First two components used only if * an integer. Use either this or the @ref TextureOffset attribute.
* @ref Flag::InstancedTextureOffset is set, third component only if * First two components used only if @ref Flag::InstancedTextureOffset
* @ref Flag::TextureArrays is set. * is set, third component only if @ref Flag::TextureArrays is set.
* @requires_gl33 Extension @gl_extension{EXT,gpu_shader4}, * @requires_gl33 Extension @gl_extension{EXT,gpu_shader4},
* @gl_extension{EXT,texture_array} and * @gl_extension{EXT,texture_array} and
* @gl_extension{ARB,instanced_arrays} * @gl_extension{ARB,instanced_arrays}
@ -2161,11 +2176,12 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
* and combines the value from @ref setDrawOffset() with the * and combines the value from @ref setDrawOffset() with the
* @glsl gl_DrawID @ce builtin, which makes draws submitted via * @glsl gl_DrawID @ce builtin, which makes draws submitted via
* @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&) * @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&)
* pick up per-draw parameters directly, without having to rebind * and related APIs pick up per-draw parameters directly, without
* the uniform buffers or specify @ref setDrawOffset() before each * having to rebind the uniform buffers or specify
* draw. In a non-multidraw scenario, @glsl gl_DrawID @ce is * @ref setDrawOffset() before each draw. In a non-multidraw
* @cpp 0 @ce, which means a shader with this flag enabled can be * scenario, @glsl gl_DrawID @ce is @cpp 0 @ce, which means a
* used for regular draws as well. * shader with this flag enabled can be used for regular draws as
* well.
* @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object} * @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object}
* and @gl_extension{ARB,shader_draw_parameters} * and @gl_extension{ARB,shader_draw_parameters}
* @requires_es_extension OpenGL ES 3.0 and extension * @requires_es_extension OpenGL ES 3.0 and extension
@ -2229,7 +2245,11 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL3D: public Implementation::MeshVisua
#endif #endif
}; };
/** @brief Flags */ /**
* @brief Flags
*
* @see @ref flags(), @ref Configuration::setFlags()
*/
typedef Containers::EnumSet<Flag> Flags; typedef Containers::EnumSet<Flag> Flags;
/** /**

75
src/Magnum/Shaders/PhongGL.h

@ -360,7 +360,7 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief Vertex position * @brief Vertex position
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector3 "Vector3". * @relativeref{Magnum,Vector3}.
*/ */
typedef GenericGL3D::Position Position; typedef GenericGL3D::Position Position;
@ -368,7 +368,7 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief Normal direction * @brief Normal direction
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector3 "Vector3". Used only if @ref lightCount() isn't * @relativeref{Magnum,Vector3}. Used only if @ref lightCount() isn't
* @cpp 0 @ce. * @cpp 0 @ce.
*/ */
typedef GenericGL3D::Normal Normal; typedef GenericGL3D::Normal Normal;
@ -378,7 +378,7 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @m_since{2019,10} * @m_since{2019,10}
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector3 "Vector3". Use either this or the @ref Tangent4 * @relativeref{Magnum,Vector3}. Use either this or the @ref Tangent4
* attribute. If only a three-component attribute is used and * attribute. If only a three-component attribute is used and
* @ref Flag::Bitangent is not enabled, it's the same as if * @ref Flag::Bitangent is not enabled, it's the same as if
* @ref Tangent4 was specified with the fourth component always being * @ref Tangent4 was specified with the fourth component always being
@ -393,7 +393,7 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector4 "Vector4". Use either this or the @ref Tangent * @relativeref{Magnum,Vector4}. Use either this or the @ref Tangent
* attribute. If @ref Flag::Bitangent is set, the fourth component is * attribute. If @ref Flag::Bitangent is set, the fourth component is
* ignored and bitangents are taken from the @ref Bitangent attribute * ignored and bitangents are taken from the @ref Bitangent attribute
* instead. Used only if @ref Flag::NormalTexture is set and * instead. Used only if @ref Flag::NormalTexture is set and
@ -407,7 +407,7 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector3 "Vector3". Use either this or the @ref Tangent4 * @relativeref{Magnum,Vector3}. Use either this or the @ref Tangent4
* attribute. Used only if both @ref Flag::NormalTexture and * attribute. Used only if both @ref Flag::NormalTexture and
* @ref Flag::Bitangent are set and @ref lightCount() isn't @cpp 0 @ce. * @ref Flag::Bitangent are set and @ref lightCount() isn't @cpp 0 @ce.
* @see @ref Shaders-PhongGL-normal-mapping * @see @ref Shaders-PhongGL-normal-mapping
@ -418,7 +418,7 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief 2D texture coordinates * @brief 2D texture coordinates
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector2 "Vector2", used only if at least one of * @relativeref{Magnum,Vector2}, used only if at least one of
* @ref Flag::AmbientTexture, @ref Flag::DiffuseTexture and * @ref Flag::AmbientTexture, @ref Flag::DiffuseTexture and
* @ref Flag::SpecularTexture is set. * @ref Flag::SpecularTexture is set.
*/ */
@ -449,8 +449,9 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief Joint ids * @brief Joint ids
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4ui. * @ref shaders-generic "Generic attribute",
* Used only if @ref perVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4ui}. Used only if
* @ref perVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -463,8 +464,9 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief Weights * @brief Weights
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4. * @ref shaders-generic "Generic attribute",
* Used only if @ref perVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4}. Used only if
* @ref perVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -477,8 +479,9 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief Secondary joint ids * @brief Secondary joint ids
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4ui. * @ref shaders-generic "Generic attribute",
* Used only if @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4ui}. Used only if
* @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -491,8 +494,9 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief Secondary weights * @brief Secondary weights
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector4. * @ref shaders-generic "Generic attribute",
* Used only if @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce. * @relativeref{Magnum,Vector4}. Used only if
* @ref secondaryPerVertexJointCount() isn't @cpp 0 @ce.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Skinning requires integer support in shaders, which * @requires_gles30 Skinning requires integer support in shaders, which
* is not available in OpenGL ES 2.0. * is not available in OpenGL ES 2.0.
@ -507,8 +511,9 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief (Instanced) object ID * @brief (Instanced) object ID
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::UnsignedInt. * @ref shaders-generic "Generic attribute",
* Used only if @ref Flag::InstancedObjectId is set. * @relativeref{Magnum,UnsignedInt}. Used only if
* @ref Flag::InstancedObjectId is set.
* @requires_gl30 Extension @gl_extension{EXT,gpu_shader4} * @requires_gl30 Extension @gl_extension{EXT,gpu_shader4}
* @requires_gles30 Object ID output requires integer support in * @requires_gles30 Object ID output requires integer support in
* shaders, which is not available in OpenGL ES 2.0. * shaders, which is not available in OpenGL ES 2.0.
@ -522,8 +527,9 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief (Instanced) transformation matrix * @brief (Instanced) transformation matrix
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Matrix4. * @ref shaders-generic "Generic attribute",
* Used only if @ref Flag::InstancedTransformation is set. * @relativeref{Magnum,Matrix4}. Used only if
* @ref Flag::InstancedTransformation is set.
* @requires_gl33 Extension @gl_extension{ARB,instanced_arrays} * @requires_gl33 Extension @gl_extension{ARB,instanced_arrays}
* @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays}, * @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays},
* @gl_extension{EXT,instanced_arrays} or * @gl_extension{EXT,instanced_arrays} or
@ -537,8 +543,9 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief (Instanced) normal matrix * @brief (Instanced) normal matrix
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Matrix3x3. * @ref shaders-generic "Generic attribute",
* Used only if @ref Flag::InstancedTransformation is set. * @relativeref{Magnum,Matrix3x3}. Used only if
* @ref Flag::InstancedTransformation is set.
* @requires_gl33 Extension @gl_extension{ARB,instanced_arrays} * @requires_gl33 Extension @gl_extension{ARB,instanced_arrays}
* @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays}, * @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays},
* @gl_extension{EXT,instanced_arrays} or * @gl_extension{EXT,instanced_arrays} or
@ -552,8 +559,9 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief (Instanced) texture offset * @brief (Instanced) texture offset
* @m_since{2020,06} * @m_since{2020,06}
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector2. Used * @ref shaders-generic "Generic attribute",
* only if @ref Flag::InstancedTextureOffset is set. * @relativeref{Magnum,Vector2}. Used only if
* @ref Flag::InstancedTextureOffset is set.
* @requires_gl33 Extension @gl_extension{ARB,instanced_arrays} * @requires_gl33 Extension @gl_extension{ARB,instanced_arrays}
* @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays}, * @requires_gles30 Extension @gl_extension{ANGLE,instanced_arrays},
* @gl_extension{EXT,instanced_arrays} or * @gl_extension{EXT,instanced_arrays} or
@ -568,11 +576,11 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* @brief (Instanced) texture offset and layer * @brief (Instanced) texture offset and layer
* @m_since_latest * @m_since_latest
* *
* @ref shaders-generic "Generic attribute", @ref Magnum::Vector3, with * @ref shaders-generic "Generic attribute",
* the last component interpreted as an integer. Use either this or the * @relativeref{Magnum,Vector3}, with the last component interpreted as
* @ref TextureOffset attribute. First two components used only if * an integer. Use either this or the @ref TextureOffset attribute.
* @ref Flag::InstancedTextureOffset is set, third component only if * First two components used only if @ref Flag::InstancedTextureOffset
* @ref Flag::TextureArrays is set. * is set, third component only if @ref Flag::TextureArrays is set.
* @requires_gl33 Extension @gl_extension{EXT,texture_array} and * @requires_gl33 Extension @gl_extension{EXT,texture_array} and
* @gl_extension{ARB,instanced_arrays} * @gl_extension{ARB,instanced_arrays}
* @requires_gles30 Texture arrays are not available in OpenGL ES 2.0. * @requires_gles30 Texture arrays are not available in OpenGL ES 2.0.
@ -797,11 +805,12 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
* and adds the value from @ref setDrawOffset() with the * and adds the value from @ref setDrawOffset() with the
* @glsl gl_DrawID @ce builtin, which makes draws submitted via * @glsl gl_DrawID @ce builtin, which makes draws submitted via
* @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&) * @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&)
* pick up per-draw parameters directly, without having to rebind * and related APIs pick up per-draw parameters directly, without
* the uniform buffers or specify @ref setDrawOffset() before each * having to rebind the uniform buffers or specify
* draw. In a non-multidraw scenario, @glsl gl_DrawID @ce is * @ref setDrawOffset() before each draw. In a non-multidraw
* @cpp 0 @ce, which means a shader with this flag enabled can be * scenario, @glsl gl_DrawID @ce is @cpp 0 @ce, which means a
* used for regular draws as well. * shader with this flag enabled can be used for regular draws as
* well.
* @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object} * @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object}
* and @gl_extension{ARB,shader_draw_parameters} * and @gl_extension{ARB,shader_draw_parameters}
* @requires_es_extension OpenGL ES 3.0 and extension * @requires_es_extension OpenGL ES 3.0 and extension
@ -895,7 +904,7 @@ class MAGNUM_SHADERS_EXPORT PhongGL: public GL::AbstractShaderProgram {
/** /**
* @brief Flags * @brief Flags
* *
* @see @ref flags() * @see @ref flags(), @ref Configuration::setFlags()
*/ */
typedef Containers::EnumSet<Flag> Flags; typedef Containers::EnumSet<Flag> Flags;

19
src/Magnum/Shaders/VectorGL.h

@ -128,8 +128,8 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT VectorGL: public GL
* @brief Vertex position * @brief Vertex position
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector2 "Vector2" in 2D, @ref Magnum::Vector3 "Vector3" * @relativeref{Magnum,Vector2} in 2D, @relativeref{Magnum,Vector3} in
* in 3D. * 3D.
*/ */
typedef typename GenericGL<dimensions>::Position Position; typedef typename GenericGL<dimensions>::Position Position;
@ -137,7 +137,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT VectorGL: public GL
* @brief 2D texture coordinates * @brief 2D texture coordinates
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector2 "Vector2". * @relativeref{Magnum,Vector2}.
*/ */
typedef typename GenericGL<dimensions>::TextureCoordinates TextureCoordinates; typedef typename GenericGL<dimensions>::TextureCoordinates TextureCoordinates;
@ -185,11 +185,12 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT VectorGL: public GL
* and adds the value from @ref setDrawOffset() with the * and adds the value from @ref setDrawOffset() with the
* @glsl gl_DrawID @ce builtin, which makes draws submitted via * @glsl gl_DrawID @ce builtin, which makes draws submitted via
* @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&) * @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&)
* pick up per-draw parameters directly, without having to rebind * and related APIs pick up per-draw parameters directly, without
* the uniform buffers or specify @ref setDrawOffset() before each * having to rebind the uniform buffers or specify
* draw. In a non-multidraw scenario, @glsl gl_DrawID @ce is * @ref setDrawOffset() before each draw. In a non-multidraw
* @cpp 0 @ce, which means a shader with this flag enabled can be * scenario, @glsl gl_DrawID @ce is @cpp 0 @ce, which means a
* used for regular draws as well. * shader with this flag enabled can be used for regular draws as
* well.
* @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object} * @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object}
* and @gl_extension{ARB,shader_draw_parameters} * and @gl_extension{ARB,shader_draw_parameters}
* @requires_es_extension OpenGL ES 3.0 and extension * @requires_es_extension OpenGL ES 3.0 and extension
@ -211,7 +212,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT VectorGL: public GL
* @brief Flags * @brief Flags
* @m_since{2020,06} * @m_since{2020,06}
* *
* @see @ref flags() * @see @ref flags(), @ref Configuration::setFlags()
*/ */
typedef Containers::EnumSet<Flag> Flags; typedef Containers::EnumSet<Flag> Flags;
#else #else

25
src/Magnum/Shaders/VertexColorGL.h

@ -27,7 +27,7 @@
*/ */
/** @file /** @file
* @brief Class @ref Magnum::Shaders::VertexColorGL * @brief Class @ref Magnum::Shaders::VertexColorGL, typedef @ref Magnum::Shaders::VertexColorGL2D, @ref Magnum::Shaders::VertexColorGL3D
* @m_since_latest * @m_since_latest
*/ */
@ -63,9 +63,9 @@ the mesh in an identity transformation. Use
@image html shaders-vertexcolor.png width=256px @image html shaders-vertexcolor.png width=256px
This shader is equivalent to @ref FlatGL with @ref FlatGL::Flag::VertexColor This shader is equivalent to @ref FlatGL with @ref FlatGL::Flag::VertexColor
enabled; the 3D version of this shader is equivalent to @ref PhongGL with enabled or to @ref PhongGL with zero lights and @ref PhongGL::Flag::VertexColor
@ref PhongGL::Flag::VertexColor enabled. In both cases this implementation is enabled. However, the implementation is much simpler and thus likely also
much simpler and thus likely also faster. faster.
Alpha / transparency is supported by the shader implicitly, but to have it Alpha / transparency is supported by the shader implicitly, but to have it
working on the framebuffer, you need to enable working on the framebuffer, you need to enable
@ -121,8 +121,8 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT VertexColorGL: publ
* @brief Vertex position * @brief Vertex position
* *
* @ref shaders-generic "Generic attribute", * @ref shaders-generic "Generic attribute",
* @ref Magnum::Vector2 "Vector2" in 2D @ref Magnum::Vector3 "Vector3" * @relativeref{Magnum,Vector2} in 2D, @relativeref{Magnum,Vector3} in
* in 3D. * 3D.
*/ */
typedef typename GenericGL<dimensions>::Position Position; typedef typename GenericGL<dimensions>::Position Position;
@ -178,11 +178,12 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT VertexColorGL: publ
* and adds the value from @ref setDrawOffset() with the * and adds the value from @ref setDrawOffset() with the
* @glsl gl_DrawID @ce builtin, which makes draws submitted via * @glsl gl_DrawID @ce builtin, which makes draws submitted via
* @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&) * @ref GL::AbstractShaderProgram::draw(const Containers::Iterable<MeshView>&)
* pick up per-draw parameters directly, without having to rebind * and related APIs pick up per-draw parameters directly, without
* the uniform buffers or specify @ref setDrawOffset() before each * having to rebind the uniform buffers or specify
* draw. In a non-multidraw scenario, @glsl gl_DrawID @ce is * @ref setDrawOffset() before each draw. In a non-multidraw
* @cpp 0 @ce, which means a shader with this flag enabled can be * scenario, @glsl gl_DrawID @ce is @cpp 0 @ce, which means a
* used for regular draws as well. * shader with this flag enabled can be used for regular draws as
* well.
* @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object} * @requires_gl46 Extension @gl_extension{ARB,uniform_buffer_object}
* and @gl_extension{ARB,shader_draw_parameters} * and @gl_extension{ARB,shader_draw_parameters}
* @requires_es_extension OpenGL ES 3.0 and extension * @requires_es_extension OpenGL ES 3.0 and extension
@ -204,7 +205,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT VertexColorGL: publ
* @brief Flags * @brief Flags
* @m_since{2020,06} * @m_since{2020,06}
* *
* @see @ref flags() * @see @ref flags(), @ref Configuration::setFlags()
*/ */
typedef Containers::EnumSet<Flag> Flags; typedef Containers::EnumSet<Flag> Flags;
#else #else

Loading…
Cancel
Save