You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: basic-3d-rendering/hello-triangle.md
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -109,11 +109,17 @@ We now detail the configuration of the **different stages**. We start with a ver
109
109
110
110
Both the **vertex fetch** and **vertex shader** stages are configured through the **vertex state** structure, accessible at `pipelineDesc.vertex`.
111
111
112
+
```{lit} C++, Describe vertex pipeline state (also for tangle root "Vanilla")
113
+
// Configure 'pipelineDesc.vertex'
114
+
{{Describe vertex buffers}}
115
+
{{Describe vertex shader}}
116
+
```
117
+
112
118
The render pipeline first **fetches vertex attributes** from some buffers that lives in GPU memory. These *attributes* include usually at least a **vertex position**, and might include additional per-vertex information like **color**, **normal**, **texture coordinate**, etc.
113
119
114
120
**In this first example**, we hard-code the position of the 3 vertices of the triangles in shaders so we do not even need a position buffer.
115
121
116
-
```{lit} C++, Describe vertex pipeline state (also for tangle root "Vanilla")
122
+
```{lit} C++, Describe vertex buffers (also for tangle root "Vanilla")
117
123
// We do not use any vertex buffer for this first simplistic example
118
124
pipelineDesc.vertex.bufferCount = 0;
119
125
pipelineDesc.vertex.buffers = nullptr;
@@ -125,7 +131,7 @@ Then each vertex is processed by a custom **vertex shader**. A shader is the com
125
131
2. An **entry point**, which is the name of the function in the shader module that must be called for each vertex. This enables a given shader module to include entry points for multiple render pipeline configurations at the same time. In particular, we use the same module for the vertex and fragment shaders.
126
132
3. An array of value assignments for the **constants** of the shader. We do not use any for now.
127
133
128
-
```{lit} C++, Describe vertex pipeline state (append, also for tangle root "Vanilla")
134
+
```{lit} C++, Describe vertex shader (also for tangle root "Vanilla")
129
135
// NB: We define the 'shaderModule' in the second part of this chapter.
130
136
// Here we tell that the programmable vertex shader stage is described
131
137
// by the function called 'vs_main' in that module.
0 commit comments