An open source library to support 360 videos and pictures. It's designed as a generic 3D library that you can use for much more!
- 360 video player
- 360 image display
- generic 3D scene
- photo / video filters within a 3D scene
See the wiki! or:
pod 'DDDKit'
import DDDKit
import AVFoundation
class ViewController: DDD360VideoViewController {
override func viewDidLoad() {
super.viewDidLoad()
show(from: myVideoURL)
}
}
// B&W filter:
@IBAction func didPressBW(_ sender: Any) {
let program = try! DDDShaderProgram(fragment: defaultShader, shaderModifiers: [
.fragment: "gl_FragColor = vec4(vec3(gl_FragColor.x + gl_FragColor.y + gl_FragColor.z) / 3.0, 1.0);",
])
videoNode.material.shaderProgram = program
}
360 cubic projection
node.geometry = DDDGeometry.Cube()
let videoTexture = DDDVideoTexture(player: player) // AVPlayer with 360 cubic video
node.material.set(
property: videoTexture,
for: "SamplerY",
and: "SamplerUV"
)
See the wiki!
- easy to use syntax and logic
- support of image and video textures
- direct and easy access to shader's code, shaders modifiers -> easy to make image filters
- focus on reliability on video support.
- equirectangular and cubic 360 support
- elements that can have any shape / position
- SceneKit has bugs, such as memory leaks, failing video support (see SO)
- no support of AVPlayerLayer / AVPlayer as video input
- indirect video support (through SpriteKit)
- openGL backed rendering failing on iOS 10
- poor documentation
- unresponsiveness from Apple on issues, and no timeline/transparency on fixes
- no access to code to fix things yourself, since it's not open source.
Guillaume Sabran, sabranguillaume@gmail.com, CTO @Pie
DDDKit is available under the MIT license. See the LICENSE file for more info.