内容表

上一话题

Hello Vulkan Texture Vulkan Example

下一话题

Hello Vulkan 小部件范例

Hello Vulkan Triangle Example

Shows the basics of rendering with QVulkanWindow and the Vulkan API.

Hello Vulkan Triangle Example builds on hellovulkanwindow . This time a full graphics pipeline is created, including a vertex and fragment shader. This pipeline is then used to render a triangle.

../_images/hellovulkantriangle.png

The example also demonstrates multisample antialiasing. Based on the supported sample counts reported by supportedSampleCounts() the example chooses between 8x, 4x, or no multisampling. Once configured via QVulkanWindow::setSamples(), QVulkanWindow takes care of the rest: the additional multisample color buffers are created automatically, and resolving into the swapchain buffers is performed at the end of the default render pass for each frame.

运行范例

要运行范例从 Qt Creator ,打开 欢迎 模式,然后选择范例从 范例 . For more information, visit Building and Running an Example.

范例工程 @ code.qt.io