{"action":"created","issue":{"url":"https://api.github.com/repos/tlgkccampbell/ultraviolet/issues/94","repository_url":"https://api.github.com/repos/tlgkccampbell/ultraviolet","labels_url":"https://api.github.com/repos/tlgkccampbell/ultraviolet/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/tlgkccampbell/ultraviolet/issues/94/comments","events_url":"https://api.github.com/repos/tlgkccampbell/ultraviolet/issues/94/events","html_url":"https://github.com/tlgkccampbell/ultraviolet/issues/94","id":363083952,"node_id":"MDU6SXNzdWUzNjMwODM5NTI=","number":94,"title":"Flexible VertexBuffer","user":{"login":"RUSshy","id":18348637,"node_id":"MDQ6VXNlcjE4MzQ4NjM3","avatar_url":"https://avatars0.githubusercontent.com/u/18348637?v=4","gravatar_id":"","url":"https://api.github.com/users/RUSshy","html_url":"https://github.com/RUSshy","followers_url":"https://api.github.com/users/RUSshy/followers","following_url":"https://api.github.com/users/RUSshy/following{/other_user}","gists_url":"https://api.github.com/users/RUSshy/gists{/gist_id}","starred_url":"https://api.github.com/users/RUSshy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RUSshy/subscriptions","organizations_url":"https://api.github.com/users/RUSshy/orgs","repos_url":"https://api.github.com/users/RUSshy/repos","events_url":"https://api.github.com/users/RUSshy/events{/privacy}","received_events_url":"https://api.github.com/users/RUSshy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":30,"created_at":"2018-09-24T10:11:22Z","updated_at":"2018-10-08T13:36:30Z","closed_at":null,"author_association":"NONE","body":"Hi\r\n\r\nI try to write a gltf loader, and i am trying to figure out a way to build a vertexbuffer based on the information of the gltf file\r\n\r\n```\r\n  \"meshes\": [\r\n    {\r\n      \"name\": \"Cube.001\",\r\n      \"primitives\": [\r\n        {\r\n          \"attributes\": {\r\n            \"COLOR_0\": 5,\r\n            \"JOINTS_0\": 6,\r\n            \"JOINTS_1\": 8,\r\n            \"NORMAL\": 2,\r\n            \"POSITION\": 1,\r\n            \"TANGENT\": 3,\r\n            \"TEXCOORD_0\": 4,\r\n            \"WEIGHTS_0\": 7,\r\n            \"WEIGHTS_1\": 9\r\n          },\r\n          \"indices\": 0,\r\n          \"material\": 0\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n```\r\n\r\nAs you can see the attributes change, if no animation, it'll be without the joints and weights for example\r\n\r\nHow could i do that in my loader when i build the Mesh? a struct (IVertexType) isn't really flexible\r\n\r\nIs there a way to do something like:\r\n\r\n```\r\nvar list = new List<VertexUsage>();\r\nlist.Add(VertexUsage.Position):\r\nlist.Add(VertexUsage.Color);\r\nVertexBuffer buffer =  new VertexBuffer(list.ToArray());\r\n```\r\n?\r\n\r\nI have everything working with Assimp, but i assume all models will be skinned one, wich isn't good\r\n\r\nSo i have to figure out a way to render Model/SkinnedModel without having to duplicate some code and without splitting the class in two\r\n\r\nAnd then i'll have to figure out a way to deal with the shader, wich to use and when ? Mesh.vert/SkinnedMesh.vert\r\n\r\nI read about uber shader, but that means compile new shader with different define all the time, this is slow no ?\r\n\r\nAnd how would i do that in ultraviolet ?\r\n\r\nI moved to Urho3D so i don't have to deal with that kind of problem, but i really want to try to build a small engine with ultraviolet, or maybe i am too lazy and stupid for that task xD with may be true lol"},"comment":{"url":"https://api.github.com/repos/tlgkccampbell/ultraviolet/issues/comments/427835768","html_url":"https://github.com/tlgkccampbell/ultraviolet/issues/94#issuecomment-427835768","issue_url":"https://api.github.com/repos/tlgkccampbell/ultraviolet/issues/94","id":427835768,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzgzNTc2OA==","user":{"login":"tlgkccampbell","id":1174658,"node_id":"MDQ6VXNlcjExNzQ2NTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1174658?v=4","gravatar_id":"","url":"https://api.github.com/users/tlgkccampbell","html_url":"https://github.com/tlgkccampbell","followers_url":"https://api.github.com/users/tlgkccampbell/followers","following_url":"https://api.github.com/users/tlgkccampbell/following{/other_user}","gists_url":"https://api.github.com/users/tlgkccampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/tlgkccampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlgkccampbell/subscriptions","organizations_url":"https://api.github.com/users/tlgkccampbell/orgs","repos_url":"https://api.github.com/users/tlgkccampbell/repos","events_url":"https://api.github.com/users/tlgkccampbell/events{/privacy}","received_events_url":"https://api.github.com/users/tlgkccampbell/received_events","type":"User","site_admin":false},"created_at":"2018-10-08T13:36:30Z","updated_at":"2018-10-08T13:36:30Z","author_association":"OWNER","body":"You have to place this line somewhere in your shader:\r\n\r\n```glsl\r\n#extern skinningFlag\r\n```\r\n\r\nThe compiler will replace that line with:\r\n\r\n```glsl\r\n#define skinningFlag <value>\r\n```"}}
{"actor":{"display_login":"tlgkccampbell"}}