MetalByTutorials/10-trees-and-fog
daemyung jang b60e552956
Fill in the missing title
2022-03-16 23:26:56 +09:00
..
final/post-processing.playground Fix runtime errors 2022-03-11 09:12:46 +09:00
projects Fix runtime errors 2022-03-11 09:12:46 +09:00
references Copy source code from the official website 2021-04-15 11:39:00 +09:00
starter/post-processing.playground Fix runtime errors 2022-03-11 09:12:46 +09:00
README.md Fill in the missing title 2022-03-16 23:26:56 +09:00

README.md

Chapter 10: Fragment Post-Processing

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.