From ef42287cf9cacbffcbd9e8484dad9ea3203b3f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 01:19:06 +0100 Subject: [PATCH] Shaders: use location 1 for texture coordinates and location 2 for normals. --- src/Shaders/Phong.h | 4 ++-- src/Shaders/Phong.vert | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Shaders/Phong.h b/src/Shaders/Phong.h index 0f762a2bd..f2a4c1234 100644 --- a/src/Shaders/Phong.h +++ b/src/Shaders/Phong.h @@ -59,7 +59,7 @@ myDiffuseTexture.bind(Shaders::Phong::DiffuseTextureLayer); class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram { public: typedef Attribute<0, Vector3> Position; /**< @brief Vertex position */ - typedef Attribute<1, Vector3> Normal; /**< @brief Normal direction */ + typedef Attribute<2, Vector3> Normal; /**< @brief Normal direction */ /** * @brief Texture coordinates @@ -67,7 +67,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram { * Used only if one of @ref Flag::AmbientTexture, @ref Flag::DiffuseTexture * or @ref Flag::SpecularTexture is set. */ - typedef Attribute<2, Vector2> TextureCoordinates; + typedef Attribute<1, Vector2> TextureCoordinates; enum: Int { /** diff --git a/src/Shaders/Phong.vert b/src/Shaders/Phong.vert index cdd51147d..b9d69aa79 100644 --- a/src/Shaders/Phong.vert +++ b/src/Shaders/Phong.vert @@ -41,7 +41,7 @@ uniform highp vec3 light; #ifdef EXPLICIT_ATTRIB_LOCATION layout(location = 0) in highp vec4 position; -layout(location = 1) in mediump vec3 normal; +layout(location = 2) in mediump vec3 normal; #else in highp vec4 position; in mediump vec3 normal; @@ -49,7 +49,7 @@ in mediump vec3 normal; #ifdef TEXTURED #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 2) in mediump vec2 textureCoords; +layout(location = 1) in mediump vec2 textureCoords; #else in mediump vec2 textureCoords; #endif