Skip to content

I don't know why the drawn triangle has flaws #396

@capp-adocia

Description

@capp-adocia

Question

When I was learning how to draw a triangle at the link https://docs.vulkan.org/tutorial/latest/03_Drawing_a_triangle/03_Drawing/02_Rendering_and_presentation.html, I noticed that the triangle I drew had obvious flaws compared to the image shown in the tutorial. I really don't know why such a problem occurred.

This is the image displayed on my machine:
Image
Tutorial images:
Image

Reoccurrence of the problem

Download the 15_hello_triangle.cpp file and the slang file from the tutorial website, and compile the slang file. The file structure is as follows:

├── 15_hello_triangle.cpp
└── shaders
    ├── shader.slang
    └── slang.spv

Then run the following command:

clang++ -std=gnu++20 -DVULKAN_HPP_NO_STRUCT_CONSTRUCTORS \
"15_hello_triangle.cpp" -lglfw -lvulkan -o triangle
./triangle

Machine Environment:

  • Operating System: Kubuntu 26.04 LTS
  • Qt Version: 6.10.2
  • Kernel Version: 7.0.0-22-generic (64-bit)
  • Graphics Platform: Wayland
  • Processor: 16 × AMD Ryzen 7 5700X 8-Core Processor
  • Graphics Processor: NVIDIA GeForce RTX 3060
  • Graphics Card Driver Version: 595.71.05
  • Clang version: 19.1.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions