{"action":"created","issue":{"url":"https://api.github.com/repos/SaschaWillems/Vulkan/issues/136","repository_url":"https://api.github.com/repos/SaschaWillems/Vulkan","labels_url":"https://api.github.com/repos/SaschaWillems/Vulkan/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/SaschaWillems/Vulkan/issues/136/comments","events_url":"https://api.github.com/repos/SaschaWillems/Vulkan/issues/136/events","html_url":"https://github.com/SaschaWillems/Vulkan/issues/136","id":149565727,"number":136,"title":"Questions about texture mapping in Chopper","user":{"login":"MichaelWei1990","id":18560251,"avatar_url":"https://avatars.githubusercontent.com/u/18560251?v=3","gravatar_id":"","url":"https://api.github.com/users/MichaelWei1990","html_url":"https://github.com/MichaelWei1990","followers_url":"https://api.github.com/users/MichaelWei1990/followers","following_url":"https://api.github.com/users/MichaelWei1990/following{/other_user}","gists_url":"https://api.github.com/users/MichaelWei1990/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelWei1990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelWei1990/subscriptions","organizations_url":"https://api.github.com/users/MichaelWei1990/orgs","repos_url":"https://api.github.com/users/MichaelWei1990/repos","events_url":"https://api.github.com/users/MichaelWei1990/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelWei1990/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-19T19:53:38Z","updated_at":"2016-04-20T10:56:20Z","closed_at":"2016-04-20T10:56:20Z","body":"Hi Sascha, \r\n\r\nI have been looking into the vulkan samples, both samples and Chopper, but I am still pretty confused about how the materials/textures are mapped on the model, especially for model's sub-mesh(es). In the solutions, I did not find codes about the mapping procedure. It would be very kind of you to point me to a correct direction or where the mapping procedure is processed. \r\n\r\nBest regards, \r\nMichael Wei"},"comment":{"url":"https://api.github.com/repos/SaschaWillems/Vulkan/issues/comments/212379524","html_url":"https://github.com/SaschaWillems/Vulkan/issues/136#issuecomment-212379524","issue_url":"https://api.github.com/repos/SaschaWillems/Vulkan/issues/136","id":212379524,"user":{"login":"SaschaWillems","id":10283127,"avatar_url":"https://avatars.githubusercontent.com/u/10283127?v=3","gravatar_id":"","url":"https://api.github.com/users/SaschaWillems","html_url":"https://github.com/SaschaWillems","followers_url":"https://api.github.com/users/SaschaWillems/followers","following_url":"https://api.github.com/users/SaschaWillems/following{/other_user}","gists_url":"https://api.github.com/users/SaschaWillems/gists{/gist_id}","starred_url":"https://api.github.com/users/SaschaWillems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaschaWillems/subscriptions","organizations_url":"https://api.github.com/users/SaschaWillems/orgs","repos_url":"https://api.github.com/users/SaschaWillems/repos","events_url":"https://api.github.com/users/SaschaWillems/events{/privacy}","received_events_url":"https://api.github.com/users/SaschaWillems/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T10:56:19Z","updated_at":"2016-04-20T10:56:19Z","body":"What do you mean by \"mapping\"? If you're referring to how textures are bound to meshes, the answer are descriptor sets. You assing your textures sampler and view to a VkDescriptorImageInfo and add it to the descriptor set you want your mesh to be rendered with at your desired binding point.\r\n\r\nIf you have multiple meshes with different textures you just create multiple descriptor sets (that can share the same descritpror set layout) and bind the descriptor that contains the sampler binding with the texture you want to use for that mesh like this :+1: \r\n\r\n```\r\n// Pipeline with descriptor set layout that matches the shared descriptor sets\r\nvkCmdBindPipeline(...pipelines.mesh...);\r\n...\r\n// Mesh A\r\nvkCmdBindDescriptorSets(...&meshA.descriptorSet... );\r\nvkCmdDrawIndexed(...);\r\n// Mesh B\r\nvkCmdBindDescriptorSets(...&meshB.descriptorSet... );\r\nvkCmdDrawIndexed(...);\r\n\r\n```\r\n\r\nThis is the most straightforward way of binding textures (samplers) for different (sub)meshes.\r\n\r\nP.S. : Can you please use e.g. the official Khronos Vulkan Forums for general questions on Vulkan? I don't want the issue tracker to be used as a place for people to ask general Vulkan questions."}}