Giter Site home page Giter Site logo

imclab / sprayscape Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlecreativelab/sprayscape

0.0 2.0 0.0 38.7 MB

Sprayscape is a perfectly imperfect VR-ish camera. It is an open source Android app released on the Android Experiments platform.

Home Page: https://sprayscape.com

License: Apache License 2.0

Java 0.27% C# 5.24% GLSL 0.15% Shell 0.03% JavaScript 0.01% Objective-C++ 0.27% Objective-C 93.87% Ruby 0.15%

sprayscape's Introduction

Sprayscape

axp

Sprayscape is a perfectly imperfect VR-ish camera. It is an open source Android app released on the Android Experiments platform.

Get it on Google Play

Sprayscape

Technology

App

Sprayscape is built in Unity with native Android support. Using the Google VR SDK for Unity to handle gyroscope data and the NatCam Unity plugin for precise camera control, Sprayscape maps the camera feed on a 360 degree sphere.

The GPU makes it all possible. On user tap or touch, the camera feed is rendered to a texture at 60 frames per second. That texture is then composited with any existing textures by a fragment shader on the GPU. That same shader also handles the projection from 2D camera to a 360 sphere, creating the scape you see in app.

When a user saves a scape, a flat panorama image is stored in the app data and written to a single atlas file containing all scapes. The atlas is loaded into the scapes view the gallery of scapes with gyro navigation.

Sharing is handled by native Android code. When a user shares a scape via link, users sign-in with Google OAuth and are prompted for read and write access on Drive. All user generated content is stored on a user’s Drive account so users can delete their content at any time. With permissions in place, the Drive API v3 checks for a Sprayscape folder, creates one if lacking, and uploads the file. A share URL is presented to the user in a Native Share dialog and is also attached to the scape object on the app for easy sharing at a later date.

Facebook share is also handled natively. The panorama is prepared as an image object with appropriate EXIF data to insure proper presentation on Facebook and then presented to the user via Native Share. User selects Facebook to share to their networks.

Web Viewer

The web viewer is built using WebGL, Three, and the emerging WebVR spec via the polyfill developed at Google by Boris Smus. Using these open standards allows for an adaptive experience across desktops, tablets, and phones. WebVR support means Sprayscape’s web experience is ready for VR devices: Cardboard, Daydream, Vive, and Oculus. Additional UI and state management is handled by the lightweight Choo framework.

Develop

Some elements are not in the repository, and need to be setup before the Unity project can be built.

  • The NatCam plugin used for the camera feed is not in the repository. You can obtain a license here and put in Sprayscape/Assets/NatCam
  • The file Secrets.cs contains the hashing key for sharing. There is a sample file for creating it called Sprayscape/Assets/Scripts/Secrets.cs.sample that you can rename.
  • For uploading to Google Drive, you need to set-up an appengine instance, enable the Google Drive API, and set up an OAuth authentication for your keystore signing of the app.

After these steps the app should be ready to be built and run on your device.

Acknowledgements

Brian Kehrer, Troy Lumpkin, Dan Motzenbecker, Jeramy Morrill, James Vecore, Norm McGarry, Chris Parker, Celso de Melo, Jonas Jongejan, Glenn Cochon, Brendon Avalos, Ryan Burke

sprayscape's People

Contributors

birdimus avatar ryburke avatar

Watchers

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