Hacker News new | ask | show | jobs
by fingerlocks 907 days ago
If you RTA, that’s a perfect example of drawing a black triangle versus “A Black Triangle Moment”.

That tutorial is a general overview of all the possible boilerplate you would expect to see in a template project, and just happens to end in a triangle being drawn on the screen.

You could skip a lot of those steps. Is that 5 page section on constructing validation layers and fine tuning the debugger really necessary if your end goal was a triangle?

You can draw a triangle in Metal in thousands of lines of code too. And it’s common to have several hundred lines of pipeline descriptors, buffer management, and debug tooling before you even started encoding into your shaders. But it’s not necessary for _just a triangle_.

1 comments

That tutorial sets up a complete rendering system, and demonstrates that it works by drawing a triangle... the exact thing described in the black triangle story.

Drawing a triangle is not the end goal. That's nonsense.

Yeah we’re saying the same thing. It’s not a “Hello Triangle” tutorial.
It kind of sounds like we're saying opposite things.

You're talking about the minimum necessary for just drawing a triangle, as if that's what "hello triangle" means. That's nothing. That's pointless.

The construction of hello triangle program marks the end of setup, and the beginning of actual work.

Skipping parts because they're boilerplate, or don't directly serve to draw the triangle, defeats the purpose. That's like typing the words "hello world" into notepad because it's faster than setting up an IDE.

The first OpenGL tutorial from 30 years ago was called “Hello Triangle”. It was uselessly simple, just like the iconic “Hello World”.

The point is that the tutorial is not in the same spirit as the classic Hellos. You can draw a triangle without all that scaffolding.

(New to comment thread) The article is about setting up all the core infrastructure to start bringing content into the engine, validated by the triangle.

Even tho the Vulkan tutorial might seem like work, it’s not actually preparing you to build anything significant on top of it. This just an overview of the API, not much of a building block.

I think both sides have a point, it's just a matter of perspective. One person's "drawing a black triangle" can be another's "black triangle moment". It's turtles all the way down.

From the perspective of an experienced Vulkan programmer, it's only a basic tutorial on creating an empty stub project, which is useless in itself as the real work of creating a powerful 3D engine has yet to start. But from the perspective of a new graphics programmer without any prior Vulkan knowledge, creating a stub project capable of drawing a triangle is already an accomplishment in itself. In OpenGL, the same thing is possible in 50 lines of code, compared to a stub Vulkan project that explicitly defines every component using thousands lines of code. Upon finishing it, one would finally have an understanding of how every part comes together, which enables further development. It would be then possible to draw many different kinds of object on top of this stub framework. In this sense, it fits the definition of:

> accomplishments that take a lot of effort to achieve, but upon completion you don’t have much to show for it only that more work can now proceed.

I appreciate this perspective, good points, thanks