{"action":"opened","issue":{"url":"https://api.github.com/repos/KhronosGroup/glTF/issues/369","labels_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/369/comments","events_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/369/events","html_url":"https://github.com/KhronosGroup/glTF/issues/369","id":62530725,"number":369,"title":"Converter generates incorrect shaders or attributes?","user":{"login":"pjcozzi","id":782098,"avatar_url":"https://avatars.githubusercontent.com/u/782098?v=3","gravatar_id":"","url":"https://api.github.com/users/pjcozzi","html_url":"https://github.com/pjcozzi","followers_url":"https://api.github.com/users/pjcozzi/followers","following_url":"https://api.github.com/users/pjcozzi/following{/other_user}","gists_url":"https://api.github.com/users/pjcozzi/gists{/gist_id}","starred_url":"https://api.github.com/users/pjcozzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjcozzi/subscriptions","organizations_url":"https://api.github.com/users/pjcozzi/orgs","repos_url":"https://api.github.com/users/pjcozzi/repos","events_url":"https://api.github.com/users/pjcozzi/events{/privacy}","received_events_url":"https://api.github.com/users/pjcozzi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/KhronosGroup/glTF/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/KhronosGroup/glTF/labels/converter","name":"converter","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-17T22:14:16Z","updated_at":"2015-03-17T22:14:16Z","closed_at":null,"body":"@fabrobinet can you look at this?  The model is attached here: https://groups.google.com/forum/#!topic/cesium-dev/pi20u3DWPTc\r\n\r\nWhat looks to be a valid COLLADA model (well, at least it loads in Mac Preview and Xcode) generates either incorrect shaders and/or incomplete (and extra) vertex attributes.\r\n\r\nThis model generates three meshes, each of which has one primitive.  These primitives have the following attributes:\r\n```\r\nGeometry0: POSITION, NORMAL, TEXCOORD_0\r\nGeometry1: POSITION\r\nGeometry2: POSITION\r\n```\r\n(Not the original COLLADA model does not have any textures, perhaps this is the problem?)\r\n\r\nHowever, the generated vertex shader expects `POSITION` and `NORMAL` (so `Geometry0` has extra attributes and the other geometries are missing the `NORMAL` attribute):\r\n```\r\nprecision highp float;\r\nvarying vec3 v_normal;\r\nuniform vec4 u_ambient;\r\nuniform vec4 u_diffuse;\r\nuniform vec4 u_specular;\r\nuniform float u_shininess;\r\nvoid main(void) {\r\nvec3 normal = normalize(v_normal);\r\nvec4 color = vec4(0., 0., 0., 0.);\r\nvec4 diffuse = vec4(0., 0., 0., 1.);\r\nvec4 ambient;\r\nvec4 specular;\r\nambient = u_ambient;\r\ndiffuse = u_diffuse;\r\nspecular = u_specular;\r\ndiffuse.xyz *= max(dot(normal,vec3(0.,0.,1.)), 0.);\r\ncolor.xyz += diffuse.xyz;\r\ncolor = vec4(color.rgb * diffuse.a, diffuse.a);\r\ngl_FragColor = color;\r\n}\r\n```\r\nThis causes Cesium to fail to render it.\r\n\r\nLoading and saving in Xcode does not help."}}