diff --git a/src/Shaders/AbstractTextShader.h b/src/Shaders/AbstractTextShader.h index 350b519ac..8f391c1f5 100644 --- a/src/Shaders/AbstractTextShader.h +++ b/src/Shaders/AbstractTextShader.h @@ -33,7 +33,7 @@ namespace Magnum { namespace Shaders { template class AbstractTextShader: public AbstractShaderProgram { public: /** @brief Vertex position */ - typedef Attribute<0, typename DimensionTraits::PointType> Position; + typedef Attribute<0, typename DimensionTraits::VectorType> Position; /** @brief Texture coordinates */ typedef Attribute<1, Vector2> TextureCoordinates; diff --git a/src/Shaders/FlatShader.h b/src/Shaders/FlatShader.h index 93a020a4a..6eb110a3c 100644 --- a/src/Shaders/FlatShader.h +++ b/src/Shaders/FlatShader.h @@ -38,7 +38,7 @@ Draws whole mesh with one color. template class MAGNUM_SHADERS_EXPORT FlatShader: public AbstractShaderProgram { public: /** @brief Vertex position */ - typedef Attribute<0, typename DimensionTraits::PointType> Position; + typedef Attribute<0, typename DimensionTraits::VectorType> Position; explicit FlatShader(); diff --git a/src/Shaders/FlatShader2D.vert b/src/Shaders/FlatShader2D.vert index b976b595c..a976a1c7f 100644 --- a/src/Shaders/FlatShader2D.vert +++ b/src/Shaders/FlatShader2D.vert @@ -9,11 +9,11 @@ uniform highp mat3 transformationProjectionMatrix; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) in highp vec3 position; +layout(location = 0) in highp vec2 position; #else -in highp vec3 position; +in highp vec2 position; #endif void main() { - gl_Position.xywz = vec4(transformationProjectionMatrix*position, 0.0); + gl_Position.xywz = vec4(transformationProjectionMatrix*vec3(position, 1.0), 0.0); } diff --git a/src/Shaders/PhongShader.h b/src/Shaders/PhongShader.h index b37d93361..a82f4c93b 100644 --- a/src/Shaders/PhongShader.h +++ b/src/Shaders/PhongShader.h @@ -35,7 +35,7 @@ otherwise falls back to GLSL 1.20. */ class MAGNUM_SHADERS_EXPORT PhongShader: public AbstractShaderProgram { public: - typedef Attribute<0, Point3D> Position; /**< @brief Vertex position */ + typedef Attribute<0, Vector3> Position; /**< @brief Vertex position */ typedef Attribute<1, Vector3> Normal; /**< @brief Normal direction */ explicit PhongShader(); diff --git a/src/Shaders/TextShader2D.vert b/src/Shaders/TextShader2D.vert index 98ee96d84..9b3816650 100644 --- a/src/Shaders/TextShader2D.vert +++ b/src/Shaders/TextShader2D.vert @@ -10,16 +10,16 @@ uniform highp mat3 transformationProjectionMatrix; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) in highp vec3 position; +layout(location = 0) in highp vec2 position; layout(location = 1) in mediump vec2 textureCoordinates; #else -in highp vec3 position; +in highp vec2 position; in mediump vec2 textureCoordinates; #endif out vec2 fragmentTextureCoordinates; void main() { - gl_Position.xywz = vec4(transformationProjectionMatrix*position, 0.0); + gl_Position.xywz = vec4(transformationProjectionMatrix*vec3(position, 1.0), 0.0); fragmentTextureCoordinates = textureCoordinates; } diff --git a/src/Shaders/VertexColorShader.h b/src/Shaders/VertexColorShader.h index 3ac86aaec..4f0275d3f 100644 --- a/src/Shaders/VertexColorShader.h +++ b/src/Shaders/VertexColorShader.h @@ -38,7 +38,7 @@ Draws vertex-colored mesh. template class MAGNUM_SHADERS_EXPORT VertexColorShader: public AbstractShaderProgram { public: /** @brief Vertex position */ - typedef Attribute<0, typename DimensionTraits::PointType> Position; + typedef Attribute<0, typename DimensionTraits::VectorType> Position; /** @brief Vertex color */ typedef Attribute<1, Color3<>> Color; diff --git a/src/Shaders/VertexColorShader2D.vert b/src/Shaders/VertexColorShader2D.vert index ff300a5b1..1272488e2 100644 --- a/src/Shaders/VertexColorShader2D.vert +++ b/src/Shaders/VertexColorShader2D.vert @@ -10,16 +10,16 @@ uniform highp mat3 transformationProjectionMatrix; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) in highp vec3 position; +layout(location = 0) in highp vec2 position; layout(location = 1) in lowp vec3 color; #else -in highp vec3 position; +in highp vec2 position; in lowp vec3 color; #endif out lowp vec3 interpolatedColor; void main() { - gl_Position.xywz = vec4(transformationProjectionMatrix*position, 0.0); + gl_Position.xywz = vec4(transformationProjectionMatrix*vec3(position, 1.0), 0.0); interpolatedColor = color; }