Browse Source

Shaders: doc++

pull/364/head
Vladimír Vondruš 7 years ago
parent
commit
c78d6d9adc
  1. 2
      src/Magnum/Shaders/DistanceFieldVector.h
  2. 13
      src/Magnum/Shaders/Flat.h
  3. 2
      src/Magnum/Shaders/MeshVisualizer.h
  4. 26
      src/Magnum/Shaders/Phong.h
  5. 2
      src/Magnum/Shaders/Vector.h
  6. 2
      src/Magnum/Shaders/VertexColor.h

2
src/Magnum/Shaders/DistanceFieldVector.h

@ -75,7 +75,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT DistanceFieldVector
/** /**
* @brief Construct without creating the underlying OpenGL object * @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 * in cases where you will overwrite the instance later anyway. Move
* another object over it to make it useful. * another object over it to make it useful.
* *

13
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 Use @ref setTransformationProjectionMatrix(), @ref setColor() and others to
configure the shader. configure the shader.
If you want to use a texture, you need to provide also @ref TextureCoordinates If you want to use a texture, you need to provide also the
attribute. Pass @ref Flag::Textured to the constructor and then at render time @ref TextureCoordinates attribute. Pass @ref Flag::Textured to the constructor
don't forget to bind also the texture via @ref bindTexture(). The texture is and then at render time don't forget to bind also the texture via
multipled by the color, which is by default set to @cpp 0xffffffff_rgbaf @ce. @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. For coloring the texture based on intensity you can use the @ref Vector shader.
@ -217,7 +218,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT Flat: public GL::Ab
/** /**
* @brief Construct without creating the underlying OpenGL object * @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 * in cases where you will overwrite the instance later anyway. Move
* another object over it to make it useful. * another object over it to make it useful.
* *
@ -257,7 +258,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT Flat: public GL::Ab
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* If @ref Flag::Textured is set, initial value is * 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. * texture.
* @see @ref bindTexture() * @see @ref bindTexture()
*/ */

2
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 * @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 * in cases where you will overwrite the instance later anyway. Move
* another object over it to make it useful. * another object over it to make it useful.
* *

26
src/Magnum/Shaders/Phong.h

@ -40,19 +40,19 @@ namespace Magnum { namespace Shaders {
/** /**
@brief Phong shader @brief Phong shader
Uses ambient, diffuse and specular color or texture. For colored mesh you need Uses ambient, diffuse and specular color or texture. For a colored mesh you
to provide the @ref Position and @ref Normal attributes in your triangle mesh. need to provide the @ref Position and @ref Normal attributes in your triangle
By default, the shader renders the mesh with a white color in an identity mesh. By default, the shader renders the mesh with a white color in an identity
transformation. Use @ref setTransformationMatrix(), @ref setNormalMatrix(), transformation. Use @ref setTransformationMatrix(), @ref setNormalMatrix(),
@ref setProjectionMatrix(), @ref setLightPosition() and others to configure @ref setProjectionMatrix(), @ref setLightPosition() and others to configure
the shader. the shader.
If you want to use textures, you need to provide also @ref TextureCoordinates If you want to use textures, you need to provide also the
attribute. Pass appropriate @ref Flags to constructor and then at render time @ref TextureCoordinates attribute. Pass appropriate @ref Flag combination to
don't forget to also call appropriate subset of @ref bindAmbientTexture(), the constructor and then at render time don't forget to also call appropriate subset of @ref bindAmbientTexture(), @ref bindDiffuseTexture() and
@ref bindDiffuseTexture() and @ref bindSpecularTexture() (or the combined @ref bindSpecularTexture() (or the combined @ref bindTextures()). The texture
@ref bindTextures()). The texture is multipled by the color, which is by is multipled by the color, which is by default set to fully opaque white for
default set to fully opaque white for enabled textures. enabled textures.
@image html shaders-phong.png width=256px @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 platforms. With proper depth sorting and blending you'll usually get much
better performance and output quality. better performance and output quality.
For general alpha-masked drawing you need to provide ambient texture with alpha For general alpha-masked drawing you need to provide an ambient texture with
channel and set alpha channel of diffuse/specular color to @cpp 0.0f @ce so alpha channel and set alpha channel of the diffuse/specular color to @cpp 0.0f @ce
only ambient alpha will be taken into account. If you have diffuse texture 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 combined with the alpha mask, you can use that texture for both ambient and
diffuse part and then separate the alpha like this: 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 * @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 * in cases where you will overwrite the instance later anyway. Move
* another object over it to make it useful. * another object over it to make it useful.
* *

2
src/Magnum/Shaders/Vector.h

@ -71,7 +71,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT Vector: public Abst
/** /**
* @brief Construct without creating the underlying OpenGL object * @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 * in cases where you will overwrite the instance later anyway. Move
* another object over it to make it useful. * another object over it to make it useful.
* *

2
src/Magnum/Shaders/VertexColor.h

@ -102,7 +102,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT VertexColor: public
/** /**
* @brief Construct without creating the underlying OpenGL object * @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 * in cases where you will overwrite the instance later anyway. Move
* another object over it to make it useful. * another object over it to make it useful.
* *

Loading…
Cancel
Save