Some small fixes.

pull/43/head
Mark Hildreth 4 years ago
parent 6ffa5c044c
commit f61585f85b

@ -11,7 +11,7 @@ A vertex is a point in 3d space (can also be 2d). These vertices are then bundle
<img src="./tutorial3-pipeline-vertices.png" />
Most modern rendering uses triangles to make simple shapes such as cube, and complex shapes such as person.
Most modern rendering uses triangles to make all shapes, from simple (such as cubes) to complex (such as people).
<!-- Todo: Find/make an image to put here -->
@ -27,7 +27,7 @@ In order to do that, we're going to need something to do the conversion. Add the
```toml
[dependencies]
# ...
glsl-to-spirv = "0.1"
cshader = "0.6"
```
We'll use this in a bit, but first let's create the shaders.

@ -7,7 +7,7 @@ You were probably getting sick of me saying stuff like "we'll get to that when w
A buffer is a blob of data on the GPU. A buffer is guaranteed to be contiguous, meaning that all the data is store sequentially in memory. Buffer's generally are used to store simple things like a struct or an array, but it can store more complex stuff such as graph structures like a tree (provided all the nodes are stored together and don't reference anything outside of the buffer). We are going to use buffer's a lot, so let's get started with two of the most important one's: the vertex buffer, and the index buffer.
## The vertex buffer
Previously we've stored vertex data directly in the vertex shader. While that worked fine to get our bootstraps on, it simply won't do longterm. The types of objects we need to draw will vary in size, and recompiling the shader whenever we need to update the model would massively slow down our program. Instead we are going to use buffers to store the vertex data we want to draw. Before we do that though we need to describe what a vertex looks like. We'll do this by creating a new struct.
Previously we've stored vertex data directly in the vertex shader. While that worked fine to get our bootstraps on, it simply won't do long-term. The types of objects we need to draw will vary in size, and recompiling the shader whenever we need to update the model would massively slow down our program. Instead we are going to use buffers to store the vertex data we want to draw. Before we do that though we need to describe what a vertex looks like. We'll do this by creating a new struct.
```rust
// main.rs
@ -83,7 +83,6 @@ Self {
swap_chain,
render_pipeline,
vertex_buffer,
hidpi_factor,
size,
}
```
@ -324,7 +323,6 @@ Self {
// NEW!
index_buffer,
num_indices,
hidpi_factor,
size,
}
```

Loading…
Cancel
Save