티스토리 뷰

https://navoshta.com/metal-camera-part-1-camera-session/

 

Metal Camera Tutorial Part 1: Getting raw camera data

A lot of apps nowadays use iPhone and iPad cameras. Some even do pretty badass things with it (performance wise), like running each frame through a neural network or applying a realtime filter. Either way you may want to get as low as you can in terms of t

navoshta.com

 

Getting raw camera data

  1. Initialize AVCaptureSession
  2. Get AVCaptureDevice
  3. Add AVCaptureDeviceInput to Session
  4. Add AVCaptureVideoDataOutput to Session
  5. Start Session

 

Converting sample buffer to a metal texture

  1. Get each frame data from CMSampleBuffer
  2. Convert frame to a metal texture MtlTexture

 

Rendering a Metal Texture

  1. Initialize MTKView
  2. Implement shaders in Metal shading language
  3. Drawing
    1. Create MTLRenderPipelineState listing graphics shader functions you are intended to use.
    2. Create MTLcommandBuffer that will eventually dispatch your commands for execution by the GPU.
    3. Create MTLRenderCommandEncoder that will let you specify shader functions context, like provide input and output for each.
    4. Commit the commands
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함