{"action":"created","issue":{"url":"https://api.github.com/repos/iamgreaser/iceball/issues/166","labels_url":"https://api.github.com/repos/iamgreaser/iceball/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/iamgreaser/iceball/issues/166/comments","events_url":"https://api.github.com/repos/iamgreaser/iceball/issues/166/events","html_url":"https://github.com/iamgreaser/iceball/issues/166","id":58126909,"number":166,"title":"Yes, we have no shader support","user":{"login":"iamgreaser","id":138113,"avatar_url":"https://avatars.githubusercontent.com/u/138113?v=3","gravatar_id":"","url":"https://api.github.com/users/iamgreaser","html_url":"https://github.com/iamgreaser","followers_url":"https://api.github.com/users/iamgreaser/followers","following_url":"https://api.github.com/users/iamgreaser/following{/other_user}","gists_url":"https://api.github.com/users/iamgreaser/gists{/gist_id}","starred_url":"https://api.github.com/users/iamgreaser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamgreaser/subscriptions","organizations_url":"https://api.github.com/users/iamgreaser/orgs","repos_url":"https://api.github.com/users/iamgreaser/repos","events_url":"https://api.github.com/users/iamgreaser/events{/privacy}","received_events_url":"https://api.github.com/users/iamgreaser/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/iamgreaser/iceball/labels/engine","name":"engine","color":"F7A428"},{"url":"https://api.github.com/repos/iamgreaser/iceball/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-18T20:57:41Z","updated_at":"2015-02-22T21:41:06Z","closed_at":null,"body":"Here's what this entails:\r\n\r\n* The VA API needs more formats, mostly to deal with attributes. Thus, glVertexAttribPointer and glEnableVertexArray.\r\n* We need multitexturing, and thus va_render_* needs to be able to take a **list** of textures.\r\n\r\nExtra formats should be declared something like this: \"3v,3c,2t,2t,2t,2t,4a,4a,3a,1a,2a\" - which would mean \"3d vertex, 3d colour, 4 2d texcoords, a 4d vector for the first attribute, a 4d vector for the second attribute, and likewise with a 3d, a 1d, and a 2d vector.\"\r\n\r\nHere's the functions I'm thinking of making:\r\n\r\n* shader, result = client.glsl_create(vertex_src_string, fragment_src_string) - Create a shader. Returns a GC'd userdata handle in \"shader\" on success, and nil on failure. \"result\" is just the shader compiler output.\r\n* client.glsl_use(shader) - Uses a shader. Pass nil to use no shader instead.\r\n* client.glsl_get_uniform(name) - Gets the location of a uniform value.\r\n* client.glsl_set_uniform_*(uniform_idx, val1[, val2[, val3[, val4]]]) - Sets a uniform, given a format - i, ui, f.\r\n* glver = client.gfx_glsl_available() - Returns \"2.1\" if we have OpenGL 2.1, \"2.0\" if we have OpenGL 2.0, and nil if we can't use shaders (unless of course we're using GLES2, in which case that would have its own function to prevent people from dropping real GL shaders into ES2).\r\n* tex_units = client.gfx_tex_available() - Returns a number indicating how many texture units we have.\r\n"},"comment":{"url":"https://api.github.com/repos/iamgreaser/iceball/issues/comments/75462446","html_url":"https://github.com/iamgreaser/iceball/issues/166#issuecomment-75462446","issue_url":"https://api.github.com/repos/iamgreaser/iceball/issues/166","id":75462446,"user":{"login":"iamgreaser","id":138113,"avatar_url":"https://avatars.githubusercontent.com/u/138113?v=3","gravatar_id":"","url":"https://api.github.com/users/iamgreaser","html_url":"https://github.com/iamgreaser","followers_url":"https://api.github.com/users/iamgreaser/followers","following_url":"https://api.github.com/users/iamgreaser/following{/other_user}","gists_url":"https://api.github.com/users/iamgreaser/gists{/gist_id}","starred_url":"https://api.github.com/users/iamgreaser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamgreaser/subscriptions","organizations_url":"https://api.github.com/users/iamgreaser/orgs","repos_url":"https://api.github.com/users/iamgreaser/repos","events_url":"https://api.github.com/users/iamgreaser/events{/privacy}","received_events_url":"https://api.github.com/users/iamgreaser/received_events","type":"User","site_admin":false},"created_at":"2015-02-22T21:41:06Z","updated_at":"2015-02-22T21:41:06Z","body":"It appears that glBindAttribLocation is the way to go.\r\n\r\nProposed vertex attribute API - note, this may change, like, well, I think the API mentioned is slightly different from the actual API:\r\n\r\n* client.glsl_set_attrib(shader, name, index) - Sets the index of a vertex attribute - index is 0-based.\r\n\r\nLet's finish this issue off once and for all!"}}