Thanks to visit codestin.com
Credit goes to github.com

Skip to content

vertex attribute order be changed #33

@daoshengmu

Description

@daoshengmu

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;
tmpvar_2.xyz = NORMAL;
gl_Position = tmpvar_1;
xlv_COLOR0 = COLOR0;
xlv_TEXCOORD0 = TEXCOORD0;
xlv_TEXCOORD1 = (g_worldMatrix * tmpvar_2).xyz;
xlv_TEXCOORD2 = normalize((g_eyePosition.xyz - tmpvar_1.xyz));
}

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions