rest3d Web3D 2014

65
Adventures in rest3d github.com/amd/rest3d Rémi Arnaud Maxime Helen AMD

description

rest3d presentation form Web3D 2014 (Vancouver)

Transcript of rest3d Web3D 2014

Page 1: rest3d Web3D 2014

Adventures in rest3d

github.com/amd/rest3d

Rémi ArnaudMaxime Helen

AMD

Page 2: rest3d Web3D 2014

2011

2010

2009

2007

2006

2005

2008

2014

2013

2012

TIMELINE 10+ years

(Dec) 2004SCEA releases COLLADA v1.1.0

2006Khronos releases COLLADA v1.42007

COLLADA DOM released2008

Khronos releases COLLADA 1.4.1 and COLLADA 1.5

2011Khronos releases WebGL 1.0

2011Open source COLLADA conformance test

2013Khronos work on glTF

github.comKhronosGroup/glTF/

2013COLLADA 1.5 ISO standard

github.com /amd/rest3d

rest3ddiscussion

rest3d.org

SigGraph2004 BOF

(Aug) 2003COLLADA discussion

Page 3: rest3d Web3D 2014

SigGraph 2004

• First public presentation of COLLADA• http://www.collada.org/public_forum/files/

COLLADASigGraphTechTalkWebQuality.pdf

Page 4: rest3d Web3D 2014

2004 design goals

Page 5: rest3d Web3D 2014

Client / Server

Database ServerDatabase Server

clientclientServerServer

3D API3D API

Server Client

ShadersShaders

COLLADA

XML DBCOLLADA

XML DB

corecore

cachecacheVarious MediaVarious Media

LocalContent

LocalContent

UIScript

UIScript

?

Page 6: rest3d Web3D 2014

Use cases• Asset repository

– Query, download, upload– asset store, archivals

• Content delivery– Web browser– Mobile / native apps

• Content Creation– Local modeling tools, local content– Exporter, version control– Local modifications, WYSIWYG– Collaboration

• User Content– Game levels– In game content

Page 7: rest3d Web3D 2014

Web Server / Web client

Database ServerDatabase Server

Web Browser / AppWeb Browser / AppHttp ServerHttp ServerHttpRequestHttpRequest

COLLADA

XML DBCOLLADA

XML DB

Server Client

XML DBXML DB

Node.js

Node.js

COLLADA

XML DBCOLLADA

XML DB

Xquery,Xslt …

Xquery,Xslt …

rest3d

Html / CSSJavascriptHtml / CSSJavascript

WebGL APIWebGL API

GLESShadersGLESShaders cachecache

LocalContent

LocalContent

Page 8: rest3d Web3D 2014

The REST architectural style• REpresentational State Transfer (REST) is a way to create, read,

update or delete information on a server.• The term representational state transfer was introduced and

defined in 2000 by Roy Fielding in his doctoral dissertation.• REST API goal is to be stateless, scalable and simple, focusing on the

(software) components• REST over HTTP relies upon Uniform Resource Identifier and HTTP

protocol• The REST architectural style is applied to the development of Web

services– Facebook, Twitter, Google, GitHub, Amazon, Netflix… provide API– A large and growing industry of applications are using those API. There

are billions of API calls a day.

Page 9: rest3d Web3D 2014

Definitions

• Resource: A single instance of an object. • Collection: A collection of Resources.• Endpoint: An URL on a Server which

represents either a Resource or an entire Collection

• Idempotent: Side-effect free, can happen multiple times with same result.

Page 10: rest3d Web3D 2014

REST HTTP verbsMost used:• GET

– Retrieve a specific Resource from the Server, or other idempotent queries. Cacheable, safe.

• POST – Everything else, with side effects (Create, Update ..). Not cacheable, unless the response

includes explicit caching information.• DELETE

– Remove a Resource from the Server. Idempotent?? Not-cacheable

Also available:• PUT

– Create or update a new Resource on the Server. Not cacheable• PATCH

– Update a resource. Not cacheable, unless the response includes explicit caching information.

Page 11: rest3d Web3D 2014

REST HTTP verbsBarely used:• HEAD

– Returns http header fields without any response body. May invalidate cache.• OPTIONS

– Retrieve information about what is allowed to do with the Resource. Should be used to self document the API. (WADL?). Non cacheable

Not used• TRACE

– Echo the request as seen by the Server – debugging purposes

• CONNECT– Proxy and tunelling

Page 12: rest3d Web3D 2014

nouns

• GET /something-ID : returns something• PUT /something-ID : send something to be

stored at something-ID• POST : send something: returns something-ID• DELETE /something-ID • PATCH /something-ID : send data, to update

something at something-ID

Page 13: rest3d Web3D 2014

http status codes

• 1xx – experimental• 2xx – Successful [*]• 3xx – Redirection• 4xx – Client Error• 5xx – Server Error

[*] – ?? suppress_response_codes=true (e.g. twitter)

Page 14: rest3d Web3D 2014

Typical status codes• 200 OK – [GET]

– The Client requested data from the Server, and the Server found it for them (Idempotent)• 201 CREATED – [POST/PUT/PATCH]

– The Client gave the Server data, and the Server created a resource• 204 NO CONTENT – [DELETE]

– The Client asked the Server to delete a Resource, and the Server deleted it• 400 INVALID REQUEST – [POST/PUT/PATCH]

– The Client gave bad data to the Server, and the Server did nothing with it (Idempotent)• 403 - Forbidden

– The Client request was understood but denied by the server. (idempotent)• 404 NOT FOUND

– The Client referenced an inexistent Resource or Collection, and the Server did nothing (Idempotent)

– 410 GONE: resource no longer available• 500 INTERNAL SERVER ERROR

– The Server encountered an error, and the Client has no knowledge if the request was successful• 501 NOT IMPLEMENTED

– The Client request is valid, but the server does not provide the service. (Idempotent)

Page 15: rest3d Web3D 2014

Use case: Asset repository

• Sketchup warehouse3dwarehouse.sketchup.com

• 3dvia warehousewww.3dvia.com

• TurboSquid marketplacewww.turbosquid.com

• Many more..tf3dm.com, daz3d.com, poserworld.com, orbolt.com, …

No API provided so far – human html browsing only.

Page 16: rest3d Web3D 2014

Sketchup warehouse main

Page 17: rest3d Web3D 2014

Sketchup warehouse model

Page 19: rest3d Web3D 2014

Asset vs Resource & Collection

• A 3D asset contains multiple Resources– Geometry, images, animation, shaders, media …– A 3D asset is a Collection, not a Resource

• A 3D asset may be combined into a single Resource– e.g. Google .kmz :: a zip file contains .dae and

images– e.g. Open XML formats :: a zip file contains XML

and images, audio, video…

Page 20: rest3d Web3D 2014

response headerAccept-Ranges:bytesAccess-Control-Allow-Origin:*Age:35Cache-Control:max-age=2592000Connection:keep-aliveContent-Disposition:attachment; filename=FurnessLibrary.kmzContent-Length:7276392Content-Type:application/vnd.google-earth.kmzDate:Sat, 05 Jul 2014 01:26:26 GMTExpires:Mon, 04 Aug 2014 01:26:26 GMTLast-Modified:Sat, 05 Jul 2014 01:26:26 UTCLast-Modified:Sat, 05 Jul 2014 01:26:26 GMTPragma:cacheServer:Restlet-Framework/2.1.7Via:1.1 854f95df95dd97f4a6eb1132740f1b0e.cloudfront.net (CloudFront)X-Amz-Cf-Id:Wjceyv_4T_rwOZhw-hZbPbsDGNpKU2QMWnyDogUJCgICJWD_VPxy5w==X-Cache:Hit from cloudfront

https://3dwarehouse.sketchup.com/3dw/getpubliccontent?contentId=d5d13872-32c2-4fb2-8b54-5291c38ac3a9&fn=FurnessLibrary.kmz

Page 21: rest3d Web3D 2014

MIME typesName MIME Type File

ExtensionMore Details

COLLADA model/vnd.collada+xml .dae IANA: COLLADA

Google Earth - Zipped KML

application/vnd.google-earth.kmz

.kmz IANA: Google Earth

JSON (generic) application/json .json RFC7158

Portable Network Graphics

image/png .png RFC 2083

X3D (XML) model/x3d+xml .x3d (pending IANA)

XML (generic) application/xml .xml RFC

Zip archive application/zip .zip

Page 22: rest3d Web3D 2014

3DVIA download

Page 23: rest3d Web3D 2014

3DVIA .dae download

Status Code:302 Found

Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0Connection:Keep-AliveContent-Encoding:gzipContent-Length:20Content-Type:text/html; charset=UTF-8Date:Sat, 05 Jul 2014 23:27:51 GMTExpires:Thu, 19 Nov 1981 08:52:00 GMTKeep-Alive:timeout=5, max=100Location:/3dsearch/Content/F1AA50E7F9CBDDEF.zip?Downloader=2&Pass=Pragma:no-cacheServer:Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e mod_jk/1.2.25 PHP/5.3.6Vary:Accept-EncodingX-Powered-By:PHP/5.3.6X-UA-Compatible:IE=edge, Chrome=1

http://www.3dvia.com/download.php?media_id=F1AA50E7F9CBDDEF&ext=zip&file=%2F3dsearch%2FContent%2FF1AA50E7F9CBDDEF.zip%3FDownloader%3D2%26Pass%3D

Page 24: rest3d Web3D 2014

3DVIA .dae (Zip) download

Cache-Control:no-cache, must-revalidateConnection:Keep-AliveContent-Disposition:attachment;filename="B_ldm_FussenNeuschwansteinCastle_T3.dae.zip"Content-Type:application/zip;charset=UTF-8Date:Sat, 05 Jul 2014 23:00:27 GMTExpires:Sat, 05 Jul 2014 23:00:27 GMTKeep-Alive:timeout=5, max=99Server:Apache-Coyote/1.1Transfer-Encoding:chunked

http://www.3dvia.com/3dsearch/Content/F1AA50E7F9CBDDEF.zip?Downloader=2&Pass=

Page 25: rest3d Web3D 2014

3DVIA .3dxml download

Page 26: rest3d Web3D 2014

3DVIA .3dxml download

Accept-Ranges:bytesCache-Control:must-revalidateConnection:Keep-AliveContent-Disposition:filename="Neuschwanstein Castle in Bavaria Germany.3dxml"Content-Length:1120364Content-Type:application/x-3dxmlplayer;charset=UTF-8Date:Sat, 05 Jul 2014 23:35:23 GMTETag:F1AA50E7F9CBDDEF.3dxml-11186c-4df9a197Expires:Sat, 05 Jul 2014 23:35:23 GMTKeep-Alive:timeout=5, max=100Last-Modified:Thu, 16 Jun 2011 06:24:45 GMTServer:Apache-Coyote/1.1

http://www.3dvia.com/3dsearch/Content/F1AA50E7F9CBDDEF.3dxml !!

Page 27: rest3d Web3D 2014

rest3d - assets• 3d assets are Collections

– They can be downloaded as zip archives– Some have a specific organization, with defined mime-type and file

extension (kmz, daz, …)– Asset need a specific ‘scene’ entry point– Allow for downloading specific resource (e.g. x.zip/image/i.png)

• rest3d should allow exploration of assets Resources– Differentiate APIs for returning asset data vs info

• Server should store resources separately– Pack on demand + cache– Allow for content update (new image patch..)– Potentially save space on server – sharing resources

• rest3d Collections contain Resources and/or other Collections.

Page 28: rest3d Web3D 2014

Rest3d – warehouse proxy

GET /rest3d/info/warehouse Get top level collectionsGET /rest3d/search/warehouse Search for models with string in nameGET /rest3d/info/warehouse/?uuid= Get Collection or Asset compositionGET /rest3d/data/warehouse/?uuid= Get an Asset (kmz or zip) or Resource (not yet implemented)

Page 29: rest3d Web3D 2014

rest3d API design

• /rest3d prefix• /rest3d/info/.. -> returns information (metadata) • /rest3d/data/.. -> returns data (e.g. kmz, zip, png)• /rest3d/search/.. -> returns matching set • /rest3d/X/database -> database selection• /rest3d/X/database?uuid= -> Universally unique

identifier for specific Resource or Asset or Collection

GET /rest3d/what/where/item

Page 30: rest3d Web3D 2014

http://127.0.0.1:8000/rest3d/info/warehouse/?uuid=c_f8fc62afb9653d03cbe9bc85eececab4

{ "database": "warehouse", "mimetype": "model/rest3d-collection+json", "page": { … }, "uuid": "c_f8fc62afb9653d03cbe9bc85eececab4", "children": { "Sketchyphysics ragdoll -- normal": { "uuid": "m_f4c7e11f3d2f35181d30c9736bb0eb9f_k2", "mimetype": "application/vnd.google-earth.kmz", … }, "Sketchyphysics ragdoll -- man": { "uuid": "m_f13c1e22e236d110a30b36db25fb7e21_k2", "mimetype": "application/vnd.google-earth.kmz", … }, "Terrain": { "uuid": "m_f0e5ff51877e125e788bfa6b4507970a_k2", "mimetype": "application/vnd.google-earth.kmz", … }, …,}

Page 31: rest3d Web3D 2014

http://127.0.0.1:8000/rest3d/search/warehouse/fisher%20fine%20art%20library

{ "database": "warehouse", "mimetype": "model/rest3d-collection+json", "page": { … }, "search": "fisher%20fine%20art%20library", "children": { "Fisher Fine Arts Library": { "uuid": "m_71187c14aab1b33bdc0d3b8ac51c2a32_k2", "mimetype": "application/vnd.google-earth.kmz", "iconUri": "https://3dwarehouse.sketchup.com/3dw/getpubliccontent?contentId=1837478f-4bb9-4e91-81d5-83a6587356fb&fn", "modelUri": "https://3dwarehouse.sketchup.com/model.html?id=71187c14aab1b33bdc0d3b8ac51c2a32", "previewUri": "https://3dwarehouse.sketchup.com/embed.html?entityId=71187c14aab1b33bdc0d3b8ac51c2a32", "description": "Furness's library at Penn is a large Gothic structure of red brick, brownstone, and terra-cotta. With its separation of the reading room from the book stacks, the building was considered highly innovative in its day. Light was admitted to the book stacks through a sloping glass roof and down through translucent glass floors. Furness studied in the atelier of Richard Morris Hunt who later became a mentor for Louis Sullivan. Model by Noel Nemcik.", "created": { "date": 1176163749000, "user": "1006372608444182407313338" }, "latitude": 39.9516751764, "longitude": -75.1927958996 } }}

Page 32: rest3d Web3D 2014

rest3d gui – Collections

Page 33: rest3d Web3D 2014

http://127.0.0.1:8000/rest3d/search/warehouse/fisher%20fine%20art%20library

{ "database": "warehouse", "mimetype": "model/rest3d-collection+json", "page": { … }, "search": "fisher%20fine%20art%20library", "children": { "Fisher Fine Arts Library": { "uuid": "m_71187c14aab1b33bdc0d3b8ac51c2a32_k2", "mimetype": "application/vnd.google-earth.kmz", "iconUri": "https://3dwarehouse.sketchup.com/3dw/getpubliccontent?contentId=1837478f-4bb9-4e91-81d5-83a6587356fb&fn", "modelUri": "https://3dwarehouse.sketchup.com/model.html?id=71187c14aab1b33bdc0d3b8ac51c2a32", "previewUri": "https://3dwarehouse.sketchup.com/embed.html?entityId=71187c14aab1b33bdc0d3b8ac51c2a32", "description": "Furness's library at Penn is a large Gothic structure of red brick, brownstone, and terra-cotta. With its separation of the reading room from the book stacks, the building was considered highly innovative in its day. Light was admitted to the book stacks through a sloping glass roof and down through translucent glass floors. Furness studied in the atelier of Richard Morris Hunt who later became a mentor for Louis Sullivan. Model by Noel Nemcik.", "created": { "date": 1176163749000, "user": "1006372608444182407313338" }, "latitude": 39.9516751764, "longitude": -75.1927958996 } }}

Page 34: rest3d Web3D 2014

http://127.0.0.1:8000/rest3d/info/warehouse/?uuid=m_71187c14aab1b33bdc0d3b8ac51c2a32_k2

{ "database": "warehouse", "mimetype": "model/rest3d-collection+json", "uuid": "m_71187c14aab1b33bdc0d3b8ac51c2a32_k2", "children": {}, "assets": { "doc.kml": "doc.kml", "images/texture0.jpg": "texture0.jpg", "images/texture0.png": "texture0.png", "images/texture1.jpg": "texture1.jpg", "images/texture1.png": "texture1.png", "images/texture10.jpg": "texture10.jpg", "images/texture11.jpg": "texture11.jpg", "images/texture12.jpg": "texture12.jpg", "images/texture13.jpg": "texture13.jpg", "images/texture59.jpg": "texture59.jpg", … snip snip … "images/texture6.jpg": "texture6.jpg", "images/texture60.jpg": "texture60.jpg", "images/texture61.jpg": "texture61.jpg", "images/texture7.jpg": "texture7.jpg", "images/texture8.jpg": "texture8.jpg", "images/texture9.jpg": "texture9.jpg", "models/model.dae": "model.dae", "textures.txt": "textures.txt" }}

---------------- resources

Page 35: rest3d Web3D 2014

rest3d ui – asset composition

Page 36: rest3d Web3D 2014

content preview• Web server can provide content preview

– Send javascript and content– rest API does not need to define content format

• Example: Pre-calculated set of imageshttps://3dwarehouse.sketchup.com/3dw/getpubliccontent?contentId=fa6c02bc-9047-4c65-b06e-7e669140c74c

• Example webGL viewerhttps://3dwarehouse.sketchup.com/embed.html?entityId=uc6f7b2c8-6775-4ef9-9ca9-4a7d2b18ee0f– Note: This is a skj file ! https

://3dwarehouse.sketchup.com/3dw/getpubliccontent?contentId=310c7591-b763-4dc3-8ace-5e1bc955cb5e&fn

• rest3d example embedded viewer– http://127.0.0.1:8000/viewer/easy-viewer.html?file=/models/cat/20_cat_smooth

_bake_channel.json&background=328a15

Page 37: rest3d Web3D 2014

rest3d application

• 3D viewer– COLLADA loader– glTF loader– rest3d webGL viewer

• ‘workstation’ style UI – Split window in viewports, resize, move– ‘applets’ running inside tabs– Based on jquery-ui, jquery-layout

• Tree views– Scene– Database exploration– …

Page 38: rest3d Web3D 2014

http://127.0.0.1:8000/viewer/viewer6.html

Page 39: rest3d Web3D 2014

rest3d implementation

sketchup 3dvia xml db

rest3d server(nodejs)

Page 40: rest3d Web3D 2014

rest3d drivers

• Provided drivers for:– warehouse/ – proxy to sketchup warehouse– 3dvia/ – proxy to 3dvia warehouse– tmp/ – temporary space available to user• Stored as files on harddirve

– db/ - XML database• Currently using eXist-db http://exist-db.org/• Could use other databases e.g baseX http://basex.org/

• Please contribute .. add more ‘drivers’ !

Page 41: rest3d Web3D 2014

Authentication (e.g. asset store, private cloud..)

• 3dvia example. Requires login.– Do not store login information on rest3d server– Login information is per database server– Protocol specific to each database server

• Authentication is not a rest3d API– But it needs to be part of the implementation– https is mandatory for sending password

Page 42: rest3d Web3D 2014

Proxy authentication

Web browser(client)

POST /rest3d/login/3dvia User: username Passwd: password

Status Code 2xx or 4xxuse cookie or http headers

https rest3d server(nodejs)

POST www.3dvia.com/login signing[user_id]: signing[user_pwd]:

Save cookiescookies['www.3dvia.com']['/'].PHPSESSIDcookies['3dvia.com']['/']['3DVIA_SESSION']

Return rest3d sessionID (cookie or custom http header)

https 3dvia

Check credentialsReturn cookies

Login/password is not stored on rest3d server3dvia cookies are not available to the client. - Web browser will not send 3dvia.com cookies to rest3d server (security) - Web browser maintain sessionID with rest3d server

Page 43: rest3d Web3D 2014

Proxy request principle

Web browser(client)

GET /rest3d/info/3dvia/.. cookie: sessionID

Data is available

https rest3d server(nodejs)

3dvia drive retrieve 3dvia cookies from sessionID store

GET www.3dvia.com/… + 3dvia cookies

return data

https 3dvia

Check credentialsReturn data

rest3d server has a cache – local file systemWhen possible - data is public & available as-is on – rest3d server sends a 302

Page 44: rest3d Web3D 2014

Third party authentification(e.g. Google oauth2)

Web browser(client)

POST /rest3d/login/db

POST /google/login

Interactive session

connectedGoogle Cookie is set http/rest3d?openid.xx

Reload!

https rest3d server(nodejs)

302 www.google.com/loginReturnURL =/rest3d/auth/ret

http://Return URLMap googleID with SessionID302 Final redirect (/viewer/)

https google

Login page, set cookies

302 ReturnURLWith openid.xx params

Check credentials

Oauth does not work in iFramepotentially lost local data from web browser

Page 45: rest3d Web3D 2014

DB access example

Web browser(client)

GET /rest3d/info/db/.. cookie: sessionID

Data is available

https rest3d server(nodejs)

Retrieve GoogleID from sessionID

GET www.xml.com with GoogleID(or other protocols)

return data

XML Database

Check credentialsReturn data

Page 46: rest3d Web3D 2014

search (warehouse)

Page 47: rest3d Web3D 2014

search (3dvia)

Page 48: rest3d Web3D 2014

rest3d search API ? (tbd)

• Simple: query string in title / description– /rest3d/search/database?q=xxxx

• Complex: Xquery ?– List of available fields for search ?– Search within a .dae file – e.g. return <node> with specific id

collection('/db/assets')//node[@id = $q]

Page 49: rest3d Web3D 2014

Use case: content delivery

• E.g. html page requests individual resources– Paging: Content is downloaded as needed

• Content formatting specific to target platform• Scalability and Caching are very important• Live update– Update server without disturbing current users

Page 50: rest3d Web3D 2014

CDN

CDN service provides multiple servers at several locations, faster service to end user1. rest3d request redirect to CDN service or

provides links to resources within the CDN2. if CDN has content, it delivers. Otherwise CDN

makes request to rest3d to get content.-> CDN caching works best when no requests are made to rest3d server (not even a 304), and no redirects are done to begin with

Page 51: rest3d Web3D 2014

Live update / Manifest

• Manifest contains list of all resources and their (CDN) URL

• Application use Manifest to translate resource to URL• Live update:– Server creates all new assets, and new manifest– New clients get the new manifests, current clients still use

old manifest– Option: Once all old clients have disconnected, delete old

assets/manifests• rest3D API – url vs uuid

Page 52: rest3d Web3D 2014

url vs uuidhttp://127.0.0.1:8000/rest3d/info/db

{ "database":"eXist", "name":"/", "mimetype":"model/rest3d-collection+json", "created":{ "date":1406848785182, "user":0 }, "uuid":"287083e0-1909-11e4-8f0a-b1e5aa401bc4", "children":{

}, "assets":{ "tmp/images/texture0.jpg":"639337b0-1909-11e4-8f0a-b1e5aa401bc4", "tmp/images/texture0.png":"63b565b0-1909-11e4-8f0a-b1e5aa401bc4", "tmp/textures.txt":"63be8d70-1909-11e4-8f0a-b1e5aa401bc4", "tmp/models/Chicken.dae":"63c74000-1909-11e4-8f0a-b1e5aa401bc4", "tmp/doc.kml":"63d17930-1909-11e4-8f0a-b1e5aa401bc4" }}

Those two URLs return the same resource:http://127.0.0.1:8000/rest3d/info/db/tmp/images/texture0.jpg http://127.0.0.1:8000/rest3d/info/db?uuid=639337b0-1909-11e4-8f0a-b1e5aa401bc4

Page 53: rest3d Web3D 2014

Caching

• Basic internet cache– Cache is based on entire URL, including parameters

• http://server.com/test.htm?p=1 ≠ http://server.com/test.htm?p=2

– Client check expiration date– If past due, ask again for resource– Get 304 from server -> what you have still valid

• Update expiration date

– Get new resource• Best if for assets to never expire

– No communication to server at all– Ok to have lots of resources– Manifest -> create all new assets when needed

Page 54: rest3d Web3D 2014

Format conversion• IMHO - ok to use file extension as format conversion request

– Thinking about:• http://127.0.0.1:8000/rest3d/info/db/tmp/images/texture0.jpg • http://127.0.0.1:8000/rest3d/info/db/tmp/images/texture0.png• http://127.0.0.1:8000/rest3d/info/db/tmp/images/texture0.jpg?size=1024x1024

– For reference: Amazon size code style:• http:/…/uuid.COUNTRY_CODE.SIZE_CODE.jpg

• Resource uuid -> one format, one version• Asset uuid -> one format (e.g. collada zipped package (.daz), google earth

package (.kmz)• work in progress: dae2gltf in the server

– [POST] rest3d/convert/tmp/convert .dae to glTFReturns result into tmp databaseInput from url (external or rest3d uuid)Auto-recognize input (kmz, zipped dae ..)

Page 55: rest3d Web3D 2014

Jobs (WIP)

• Need to manage server load, or distribute work• Create a return (immediately) a jobid, do not wait for

job to complete before responding to request• GET /rest3d/jobs– Get jobs list

• GET /rest3d/jobs/status/jobID• POST /rest3d/jobs/suspend/jobID• POST /rest3d/jobs/resume/jobID• POST /rest3d/jobs/kill/jobID

POST vs GET ?

Page 56: rest3d Web3D 2014

Use case: Content Creation

• Import/Export– Tools can import/export/browser using rest3d API

• Versioning• Local changes– WYSIWYG– patches

• User/Teams– Projects– Settings

Page 57: rest3d Web3D 2014

Downloading::compressionGET /encrypted-area HTTP/1.1

Host: www.example.comAccept-Encoding: gzip, deflate

• Server will compress before sending data– Why storing .gziped files then?

• Asset repository -> need packaging. Why not tar?• Content Delivery -> web app need to unzip/unpack in JavaScript

– Slower than native code.– Patch html to load images/css/scripts– Reducing the number of queries could be the right trade-off

Page 58: rest3d Web3D 2014

Uploading• Web browser cannot access hard drive

– For security. User has to provide files• Open file. Drag & Drop files

• There is no option to automatically gzip files from browser to server. – Can zip content in JavaScript. May still be the right thing to do.

• rest3d APIUpload (multiple) files[POST] /rest3d/db/collection-path

<form enctype="multipart/form-data" method="POST"> <input type="file” multiple="multiple" /></form>

Upload from url [POST] /rest3d/db/collection-path

<form enctype="multipart/form-data" method="POST"> <input id=”url" value=”http://…" /></form>

Create Collection[POST] /rest3d/db/collection-path

<form enctype="multipart/form-data" method="POST"> <input type="file" name="upload" multiple="multiple" />

</form>

Page 59: rest3d Web3D 2014

Versioning (WIP)

• One uuid = single version, single format?• Current implementation:– Collection(asset) list resources (url) with proxy uuid– Proxy uuid contains list of uuid with version info

• Better implementation?– Collection list resources with current version uuid– Need way to browse versions from current version– Similar if not identical to git architecture

• note: sha1 used for uuid. If new content is same as previous content, sha1 will be identical. Save space !

• http://git-scm.com/book/en/Git-Internals

Page 60: rest3d Web3D 2014

rest3d versioninghttp://127.0.0.1:8000/rest3d/info/db/tmp/models/Chicken.dae

Collection

Path

Page 61: rest3d Web3D 2014

Indirection (versioning){"name":"Chicken.dae","mimetype":"model/collada+xml","size":2694152,"created":{"date":1406848884309,"user":"TK7JwRquJhSsNmR5ef67Fx0FnolvmhGqLO71cTK3"},"uuid":"63861850-1909-11e4-8f0a-b1e5aa401bc4"}

Page 62: rest3d Web3D 2014

Patches - • WYSIWYG changes

– Final content get patched inside game engine– Patch files are create, and automatically applied to final content when loaded next time– 1 patch per resource– Patches can be stored locally, or on server

• Server side patch application– Reverse content pipeline?

• Seems very hard if not impossible– Apply patch after (on-demand) conversion

• Local or server based– Patch source content

• Server apply patch• Then apply on-demand content conversion• Or apply patch to source content

• Repeatable patching– Need UUID

• Most exporters do not provide consistent IDs

Page 63: rest3d Web3D 2014

Use case: user content

Page 64: rest3d Web3D 2014

Use case: user content (sell)

$$$$$$

Page 65: rest3d Web3D 2014

To be continued !

Thank you for your attentionQuestions and comments are welcomed

contact info: [email protected] code: github.com/amd/rest3d