Merge pull request #427 from erwanvivien/master

More details on geometry shader
pull/422/head
sotrh 1 year ago committed by GitHub
commit f1f504519b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -72,6 +72,7 @@ impl State {
force_fallback_adapter: false,
},
).await.unwrap();
}
```
### Instance and Adapter
@ -187,6 +188,9 @@ Regardless, `PresentMode::Fifo` will always be supported, and `PresentMode::Auto
Now that we've configured our surface properly we can add these new fields at the end of the method.
```rust
async fn new(window: &Window) -> Self {
// ...
Self {
window,
surface,
@ -196,8 +200,6 @@ Now that we've configured our surface properly we can add these new fields at th
size,
}
}
// ...
}
```
Since our `State::new()` method is async we need to change `run()` to be async as well so that we can await it.
@ -293,6 +295,8 @@ match event {
state.resize(**new_inner_size);
}
// ...
}
}
}
```

@ -4,7 +4,7 @@
If you're familiar with OpenGL, you may remember using shader programs. You can think of a pipeline as a more robust version of that. A pipeline describes all the actions the gpu will perform when acting on a set of data. In this section, we will be creating a `RenderPipeline` specifically.
## Wait, shaders?
Shaders are mini-programs that you send to the gpu to perform operations on your data. There are 3 main types of shader: vertex, fragment, and compute. There are others such as geometry shaders, but they're more of an advanced topic. For now, we're just going to use vertex, and fragment shaders.
Shaders are mini-programs that you send to the gpu to perform operations on your data. There are 3 main types of shader: vertex, fragment, and compute. There are others such as geometry shaders or tesselation shaders, but they're not supported by WebGL. They should be avoided in general, [see discussions](https://community.khronos.org/t/does-the-use-of-geometric-shaders-significantly-reduce-performance/106326). For now, we're just going to use vertex, and fragment shaders.
## Vertex, fragment... what are those?
A vertex is a point in 3d space (can also be 2d). These vertices are then bundled in groups of 2s to form lines and/or 3s to form triangles.

Loading…
Cancel
Save