Browse Source

Shaders: added Tangent generic vertex attribute.

pull/344/head
Vladimír Vondruš 7 years ago
parent
commit
528e3822dc
  1. 4
      doc/changelog.dox
  2. 8
      src/Magnum/Shaders/Generic.h
  3. 1
      src/Magnum/Shaders/generic.glsl

4
doc/changelog.dox

@ -160,6 +160,10 @@ See also:
bootstrap project for using Magnum together with wxWidgets (see bootstrap project for using Magnum together with wxWidgets (see
[mosra/magnum-bootstrap#19](https://github.com/mosra/magnum-bootstrap/pull/19)) [mosra/magnum-bootstrap#19](https://github.com/mosra/magnum-bootstrap/pull/19))
@subsubsection changelog-latest-new-shaders Shaders library
- Added @ref Shaders::Generic3D::Tangent generic vertex attribute definition
@subsubsection changelog-latest-new-text Text library @subsubsection changelog-latest-new-text Text library
- A new @ref Text::AbstractGlyphCache base now makes @ref Text::AbstractFont - A new @ref Text::AbstractGlyphCache base now makes @ref Text::AbstractFont

8
src/Magnum/Shaders/Generic.h

@ -69,6 +69,13 @@ template<UnsignedInt dimensions> struct Generic {
*/ */
typedef GL::Attribute<2, Vector3> Normal; typedef GL::Attribute<2, Vector3> Normal;
/**
* @brief Vertex tangent
*
* @ref Magnum::Vector3 "Vector3", defined only in 3D.
*/
typedef GL::Attribute<4, Vector3> Tangent;
/** /**
* @brief Three-component vertex color. * @brief Three-component vertex color.
* *
@ -136,6 +143,7 @@ template<> struct Generic<2>: BaseGeneric {
template<> struct Generic<3>: BaseGeneric { template<> struct Generic<3>: BaseGeneric {
typedef GL::Attribute<0, Vector3> Position; typedef GL::Attribute<0, Vector3> Position;
typedef GL::Attribute<2, Vector3> Normal; typedef GL::Attribute<2, Vector3> Normal;
typedef GL::Attribute<4, Vector3> Tangent;
}; };
#endif #endif

1
src/Magnum/Shaders/generic.glsl

@ -29,3 +29,4 @@
#define TEXTURECOORDINATES_ATTRIBUTE_LOCATION 1 #define TEXTURECOORDINATES_ATTRIBUTE_LOCATION 1
#define NORMAL_ATTRIBUTE_LOCATION 2 #define NORMAL_ATTRIBUTE_LOCATION 2
#define COLOR_ATTRIBUTE_LOCATION 3 #define COLOR_ATTRIBUTE_LOCATION 3
#define TANGENT_ATTRIBUTE_LOCATION 4

Loading…
Cancel
Save