vertex attribute order be changed #33

daoshengmu opened this Issue Oct 8, 2013 · 0 comments


None yet
1 participant

Here is my GLSL, POSITION is the first attribute and NORMAL should be the forth attribute

uniform vec4 g_eyePosition;
uniform mat4 g_worldMatrix;
uniform mat4 g_worldViewProjectionMatrix;
attribute vec4 POSITION;
attribute vec4 COLOR0;
attribute vec2 TEXCOORD0;
attribute vec3 NORMAL;
varying vec4 xlv_COLOR0;
varying vec2 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
void main ()
vec4 tmpvar_1;
tmpvar_1 = (g_worldViewProjectionMatrix * POSITION);
vec4 tmpvar_2;
tmpvar_2.w = 0.0; = NORMAL;
gl_Position = tmpvar_1;
xlv_COLOR0 = COLOR0;
xlv_TEXCOORD1 = (g_worldMatrix * tmpvar_2).xyz;
xlv_TEXCOORD2 = normalize(( -;

But after after glsl2agal compiler the vertex attribute be like bottom text, POSITION be shifted to the va1, and NORMAL on the va0.

"COLOR0": "va2",
"unnamed_3": "vt2",
"g_worldViewProjectionMatrix": "vc1",
"POSITION": "va1",
"TEXCOORD0": "va3",
"gl_Position": "op0",
"g_worldMatrix": "vc5",
"g_eyePosition": "vc9",
"NORMAL": "va0",
"unnamed_0": "vc0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment