Giter Club home page Giter Club logo

dddkit's Introduction

DDDKit

Swift Version Version License Platform

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!

Example of use cases

  • 360 video player
  • 360 image display
  • generic 3D scene
  • photo / video filters within a 3D scene

Installation

See the wiki! or:

pod 'DDDKit'

Quickstart

import DDDKit
import AVFoundation

class ViewController: DDD360VideoViewController {

  override func viewDidLoad() {
    super.viewDidLoad()
    show(from: myVideoURL)
  }
}

Example

Image filter (easy to be creative!)

// 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"
)

Screenshots from the demo app:

output output

Documentation

See the wiki!

Features

  • 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

Why not SceneKit?

  • 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.

Author

Guillaume Sabran, [email protected], CTO @Pie

License

DDDKit is available under the MIT license. See the LICENSE file for more info.

dddkit's People

Contributors

gsabran avatar team-pie avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.