diff --git a/10-trees-and-fog/README.md b/10-trees-and-fog/README.md new file mode 100644 index 0000000..ab21c5e --- /dev/null +++ b/10-trees-and-fog/README.md @@ -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. diff --git a/README.md b/README.md index 28a8cf1..9d6ee40 100644 --- a/README.md +++ b/README.md @@ -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