渲染API对于线渲染的支持
wireframe | line mode | line width | |
---|---|---|---|
OpenGL | glPolygonMode(GL_FRONT_AND_BACK, GL_LINE) | glDrawArrays: GL_LINES/GL_LINE_STRIP/GL_LINE_LOOP | glLineWidth |
Vulkan | VkPipelineRasterizationStateCreateInfo/VK_POLYGON_MODE_LINE | VkPipelineInputAssemblyStateCreateInfo: VK_PRIMITIVE_TOPOLOGY_LINE_LIST/VK_PRIMITIVE_TOPOLOGY_LINE_STRIP | vkCmdSetLineWidth, VkPipelineRasterizationStateCreateInfo::lineWidth |
DirectX 11 | D3D11_RASTERIZER_DESC/D3D11_FILL_WIREFRAME | IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_LINELIST) | |
DirectX 12 | D3D12_GRAPHICS_PIPELINE_STATE_DESC/D3D12_FILL_WIREFRAME | D3D12_GRAPHICS_PIPELINE_STATE_DESC/D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE, IASetPrimitiveTopology(D3D12_PRIMITIVE_TOPOLOGY_LINELIST) |
glLineWidth的文档中说只保证宽度1的设置,其他宽度依赖硬件实现。