Browse Source

Shaders: fix textured Flat on systems w/o ARB_explicit_attribute_location.

How could I possibly overlook this.
pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
ef83211c46
  1. 4
      src/Shaders/Flat.frag
  2. 8
      src/Shaders/Flat2D.vert
  3. 8
      src/Shaders/Flat3D.vert

4
src/Shaders/Flat.frag

@ -43,7 +43,7 @@ uniform lowp vec4 color;
#endif
#ifdef TEXTURED
in mediump vec2 interpolatedTextureCoords;
in mediump vec2 interpolatedTextureCoordinates;
#endif
#ifdef NEW_GLSL
@ -52,7 +52,7 @@ out lowp vec4 fragmentColor;
void main() {
#ifdef TEXTURED
fragmentColor = texture(textureData, interpolatedTextureCoords);
fragmentColor = texture(textureData, interpolatedTextureCoordinates);
#else
fragmentColor = color;
#endif

8
src/Shaders/Flat2D.vert

@ -41,11 +41,11 @@ in highp vec2 position;
#ifdef TEXTURED
#ifdef EXPLICIT_ATTRIB_LOCATION
layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) in mediump vec2 textureCoords;
layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) in mediump vec2 textureCoordinates;
#else
in mediump vec2 textureCoords;
in mediump vec2 textureCoordinates;
#endif
out mediump vec2 interpolatedTextureCoords;
out mediump vec2 interpolatedTextureCoordinates;
#endif
void main() {
@ -53,6 +53,6 @@ void main() {
#ifdef TEXTURED
/* Texture coordinates, if needed */
interpolatedTextureCoords = textureCoords;
interpolatedTextureCoordinates = textureCoordinates;
#endif
}

8
src/Shaders/Flat3D.vert

@ -41,11 +41,11 @@ in highp vec4 position;
#ifdef TEXTURED
#ifdef EXPLICIT_ATTRIB_LOCATION
layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) in mediump vec2 textureCoords;
layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) in mediump vec2 textureCoordinates;
#else
in mediump vec2 textureCoords;
in mediump vec2 textureCoordinates;
#endif
out mediump vec2 interpolatedTextureCoords;
out mediump vec2 interpolatedTextureCoordinates;
#endif
void main() {
@ -53,6 +53,6 @@ void main() {
#ifdef TEXTURED
/* Texture coordinates, if needed */
interpolatedTextureCoords = textureCoords;
interpolatedTextureCoordinates = textureCoordinates;
#endif
}

Loading…
Cancel
Save