I want to be able to draw single lines inside Vulkan but the only way I have managed to achieve this so far is by drawing a triangle with two of its points that ocupuy the same point in space. Is there a way to draw lines inside Vulkan and also change their width? I know I can change line width when I set the polygon mode in the rasterizer to VK_POLYGON_MODE_LINE and then set the lineWidth option, but I need to be able to do it whilst rendering all other 3D objects with VK_POLYGON_MODE_FILL enabled.
Asked
Active
Viewed 6,478 times
4
-
https://vulkan.lunarg.com/doc/view/1.0.33.0/linux/vkspec.chunked/ch19s01.html – Bálint Jul 20 '17 at 21:17
-
@Bálint Using that, how can I render both a VK_PRIMITIVE_TOPOLOGY_LINE_LIST and a VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST with one pipeline – 0xen Jul 20 '17 at 21:26
-
You need to create multiple pipelines for that. Switching between them is pretty fast. – Bálint Jul 20 '17 at 21:30
-
@Bálint So would it be a matter of. Starting the triangle pipeline, submit the triangle command buffer, Start the line pipeline then submit the line command buffers? – 0xen Jul 20 '17 at 21:46
-
Yeah, pretty much – Bálint Jul 20 '17 at 21:55
-
@Bálint Just had a play around and managed to get it working with a single command buffer, You need to build both pipelines, then when recording the command buffers you need to define the pipeline before you submit the draw calls and then the models will be rendered correctly – 0xen Jul 20 '17 at 22:12