Summerize Chapter 10: Fragment Post-Processing

This commit is contained in:
daemyung jang 2022-03-13 10:10:31 +09:00
parent b24fbabc4a
commit 55438ce984
No known key found for this signature in database
GPG Key ID: 44160C9958A9C67B
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,25 @@
# Chapter 9:
As I read this book, I summarize what I think is wrong. If you think my comments are wrong then please let me know. We can dicuss more and update your opinion.
## The runtime error
A metal shader file isn't included in the bundle so we can't read shader so the runtime error is happened. But a metal shader is compiled and saved as the default library. Replace code in `buildPipelineState()`:
```
guard let path = Bundle.main.path(forResource: "Shaders", ofType: "metal") else { return }
let source = try String(contentsOfFile: path, encoding: .utf8)
let library = try device.makeLibrary(source: source, options: nil)
```
to this code:
```
guard let library = device.makeDefaultLibrary() else {
fatalError("Can't make default library")
}
```
## Antialiasing
This book says that MSAA(Multisample Antialiasing) is more expeensive to compute. But it's not true in modern GPUs. Nowadays most of GPUs supports 4X MSAA almost free so don't worry about using MSAA.

View File

@ -24,6 +24,7 @@ You can see color images in this book at [here](https://www.raywenderlich.com/bo
* [Chapter 6: Textures](https://github.com/daemyung/MetalByTutorials/tree/main/06-textures)
* [Chapter 8: Character Animation](https://github.com/daemyung/MetalByTutorials/tree/main/08-character-animation)
* [Chapter 9: The Scene Graph](https://github.com/daemyung/MetalByTutorials/tree/main/09-scene-graph)
* [Chapter 10: Fragment Post-Processing](https://github.com/daemyung/MetalByTutorials/tree/main/10-trees-and-fog)
## Copyright