From c78d6d9adc957c34d277b1ccb5a4d31aab94dd25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 9 Aug 2019 17:41:42 +0200 Subject: [PATCH] Shaders: doc++ --- src/Magnum/Shaders/DistanceFieldVector.h | 2 +- src/Magnum/Shaders/Flat.h | 13 ++++++------ src/Magnum/Shaders/MeshVisualizer.h | 2 +- src/Magnum/Shaders/Phong.h | 26 ++++++++++++------------ src/Magnum/Shaders/Vector.h | 2 +- src/Magnum/Shaders/VertexColor.h | 2 +- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/Magnum/Shaders/DistanceFieldVector.h b/src/Magnum/Shaders/DistanceFieldVector.h index 85038a290..3fbb44968 100644 --- a/src/Magnum/Shaders/DistanceFieldVector.h +++ b/src/Magnum/Shaders/DistanceFieldVector.h @@ -75,7 +75,7 @@ template class MAGNUM_SHADERS_EXPORT DistanceFieldVector /** * @brief Construct without creating the underlying OpenGL object * - * The constructed instance is equivalent to moved-from state. Useful + * The constructed instance is equivalent to a moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. * diff --git a/src/Magnum/Shaders/Flat.h b/src/Magnum/Shaders/Flat.h index c67ee87a4..ca8edc278 100644 --- a/src/Magnum/Shaders/Flat.h +++ b/src/Magnum/Shaders/Flat.h @@ -59,10 +59,11 @@ shader renders the mesh with a white color in an identity transformation. Use @ref setTransformationProjectionMatrix(), @ref setColor() and others to configure the shader. -If you want to use a texture, you need to provide also @ref TextureCoordinates -attribute. Pass @ref Flag::Textured to the constructor and then at render time -don't forget to bind also the texture via @ref bindTexture(). The texture is -multipled by the color, which is by default set to @cpp 0xffffffff_rgbaf @ce. +If you want to use a texture, you need to provide also the +@ref TextureCoordinates attribute. Pass @ref Flag::Textured to the constructor +and then at render time don't forget to bind also the texture via +@ref bindTexture(). The texture is multipled by the color, which is by default +set to @cpp 0xffffffff_rgbaf @ce. For coloring the texture based on intensity you can use the @ref Vector shader. @@ -217,7 +218,7 @@ template class MAGNUM_SHADERS_EXPORT Flat: public GL::Ab /** * @brief Construct without creating the underlying OpenGL object * - * The constructed instance is equivalent to moved-from state. Useful + * The constructed instance is equivalent to a moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. * @@ -257,7 +258,7 @@ template class MAGNUM_SHADERS_EXPORT Flat: public GL::Ab * @return Reference to self (for method chaining) * * If @ref Flag::Textured is set, initial value is - * @cpp 0xffffffff_rgbaf @ce and the color will be multiplied with + * @cpp 0xffffffff_rgbaf @ce and the color will be multiplied with the * texture. * @see @ref bindTexture() */ diff --git a/src/Magnum/Shaders/MeshVisualizer.h b/src/Magnum/Shaders/MeshVisualizer.h index 31e05bf4d..d2ed527e7 100644 --- a/src/Magnum/Shaders/MeshVisualizer.h +++ b/src/Magnum/Shaders/MeshVisualizer.h @@ -164,7 +164,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public GL::AbstractShaderProgram { /** * @brief Construct without creating the underlying OpenGL object * - * The constructed instance is equivalent to moved-from state. Useful + * The constructed instance is equivalent to a moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. * diff --git a/src/Magnum/Shaders/Phong.h b/src/Magnum/Shaders/Phong.h index e25a2dcc0..b8b695295 100644 --- a/src/Magnum/Shaders/Phong.h +++ b/src/Magnum/Shaders/Phong.h @@ -40,19 +40,19 @@ namespace Magnum { namespace Shaders { /** @brief Phong shader -Uses ambient, diffuse and specular color or texture. For colored mesh you need -to provide the @ref Position and @ref Normal attributes in your triangle mesh. -By default, the shader renders the mesh with a white color in an identity +Uses ambient, diffuse and specular color or texture. For a colored mesh you +need to provide the @ref Position and @ref Normal attributes in your triangle +mesh. By default, the shader renders the mesh with a white color in an identity transformation. Use @ref setTransformationMatrix(), @ref setNormalMatrix(), @ref setProjectionMatrix(), @ref setLightPosition() and others to configure the shader. -If you want to use textures, you need to provide also @ref TextureCoordinates -attribute. Pass appropriate @ref Flags to constructor and then at render time -don't forget to also call appropriate subset of @ref bindAmbientTexture(), -@ref bindDiffuseTexture() and @ref bindSpecularTexture() (or the combined -@ref bindTextures()). The texture is multipled by the color, which is by -default set to fully opaque white for enabled textures. +If you want to use textures, you need to provide also the +@ref TextureCoordinates attribute. Pass appropriate @ref Flag combination to +the constructor and then at render time don't forget to also call appropriate subset of @ref bindAmbientTexture(), @ref bindDiffuseTexture() and +@ref bindSpecularTexture() (or the combined @ref bindTextures()). The texture +is multipled by the color, which is by default set to fully opaque white for +enabled textures. @image html shaders-phong.png width=256px @@ -87,9 +87,9 @@ operation which is known to have considerable performance impact on some platforms. With proper depth sorting and blending you'll usually get much better performance and output quality. -For general alpha-masked drawing you need to provide ambient texture with alpha -channel and set alpha channel of diffuse/specular color to @cpp 0.0f @ce so -only ambient alpha will be taken into account. If you have diffuse texture +For general alpha-masked drawing you need to provide an ambient texture with +alpha channel and set alpha channel of the diffuse/specular color to @cpp 0.0f @ce +so only ambient alpha will be taken into account. If you have a diffuse texture combined with the alpha mask, you can use that texture for both ambient and diffuse part and then separate the alpha like this: @@ -241,7 +241,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public GL::AbstractShaderProgram { /** * @brief Construct without creating the underlying OpenGL object * - * The constructed instance is equivalent to moved-from state. Useful + * The constructed instance is equivalent to a moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. * diff --git a/src/Magnum/Shaders/Vector.h b/src/Magnum/Shaders/Vector.h index 14666c69c..325f3906c 100644 --- a/src/Magnum/Shaders/Vector.h +++ b/src/Magnum/Shaders/Vector.h @@ -71,7 +71,7 @@ template class MAGNUM_SHADERS_EXPORT Vector: public Abst /** * @brief Construct without creating the underlying OpenGL object * - * The constructed instance is equivalent to moved-from state. Useful + * The constructed instance is equivalent to a moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. * diff --git a/src/Magnum/Shaders/VertexColor.h b/src/Magnum/Shaders/VertexColor.h index 97918602f..dc24aaee0 100644 --- a/src/Magnum/Shaders/VertexColor.h +++ b/src/Magnum/Shaders/VertexColor.h @@ -102,7 +102,7 @@ template class MAGNUM_SHADERS_EXPORT VertexColor: public /** * @brief Construct without creating the underlying OpenGL object * - * The constructed instance is equivalent to moved-from state. Useful + * The constructed instance is equivalent to a moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. *