Sunteți pe pagina 1din 45

Database Driven 3D Content Management Systems

By Tim Child 3DMashUp

Outline
Biography 3D Content Applications 3D Content Categories 3D Geometry 3D Samples 3D UDTs & Functions System Architecture 3D Queries Demo GPGPU Acceleration Web 2.0 Integration Performance Challenges Further Development Summary Q & A Session

Biography
Tim Child 35 years experience of software development Formerly
VP Oracle Corporation VP BEA Systems Inc. VP Informix Leader at Autodesk, Navteq, Intuit,

30 + years experience in 3D, CAD, GIS and DBMS Built >10 Spatial DBMS Applications

3D CMS Issues
Ad Hoc File/SCM based Large number for file formats Files dispersed across the users network Hard to Sync content between files Poor Web 2.0 Integration Need of Real-Time Display

3D Content Applications
Augmented/Virtual Reality Medical 10x growth in 5yr - Baptist Hospital AEC / BIM Arup predicts 70% growth in BIM data/yr GIS / Earth Sciences /Environmental Sciences CAD / CAM

Games / 3D Video

3D Content Catagories Vector Graphics Raster Graphics


Geometry
Mathematical Representations Topological Rules Many varieties of Objects Many File Formats

Samples
Measurements
Location X,Y,Z Time t Channels
R,G,B Intensity levels

Discreet/Quantized Noisy Need Calibration Scales N * N * N

Representing 3D Geometry
Point
Line Mesh

Polygon

Triangle

Representing 3D Samples
Pixel/Voxel
Quantized Intensity I (x,y,z,t)

Point Cloud Voxel Array

PostgreSQL Advanced Capabilities


Functions
Methods executing with in the server Consider them a Delegate Methods
Take the method to the data

Languages
PGSQL C (UDF) Java Others,

Types
Complex types and Arrays Used Defined Types (UDT) Examples include
XML, JSON, PostGIS

Indices
BTree RTree Inverted Index GIST 1 Dimensional Multi Dimensional Text searches Roll your own

User Defined Aggregate (UDA)


Supports Sum, Min, Max, Average,

System Overview
DCC Tools (COLLADA) PlugIn WebDav File Storage Existing CMS/SCM Web Browser View (WebGL) HTTP Server DBMS Server

Web / File Crawler

3D MashUp Service

Web Pages

SQL Table Storage

3D Analytics Service

Authentication Service

File Storage

File Storage

LDAP

Active Directory

System Architecture

3D UDTs & Functions

Current 3D Schema 75+ Functions 15+ UDTs 20 + Tables

Recap
Native SQL representation of 3D objects Supports
Vector Graphics Raster Graphics

3D Content Aware
Vector math 4 x4 Homogenous coordinate transformations Polygon to Polygon Intersections

Image processing

IMPORTANT 3D QUERIES
DBMS Goal:
Provide sufficient data to rapidly render the scene with acceptable fidelity

Camera View
Simplify Camera Field of View to a Cone

Spatial Cone Query

Spatial Indexing

Spatial Indexing allows scalable queries from > 100M Objects

View Coherent Queries

Mesh Size

Stanford Bunny 70K Triangles 39K Vertices

XYZ Dragon 7.2M Triangles 3.6M Vertices

No point in using 7M triangles to render 64 x 64 pixels

Mesh Spatial Processing


Each mesh subdivided into 1024 x 1024 x 1024 cells
Each triangle centroid is sorted on a Z Coordinate

0 - 1023

Morton Z Coordinates Each 10 bit coordinate Is bit interleaved (Z9,Y9,X9, Z0,Y0,X0)

Spatially Clustered Mesh Storage


8 KB DBMS Pages

Queries

PostgreSQL Server

Each page Contains 50 100 Mesh Triangles Spatially Clustered

Spatially clustered meshes optimizes DBMS access!

LOD Processing
On loading a Mesh Compute and Store Reduced LOD Representations

Triangle Decimation
Edge Collapsing

Cost based algorithm

Collapsing Cost based on Area and Angle Between

LOD Queries
Document Table

Query path for Detailed Objects


Mesh Table

Query path for Coarse Objects

Triangle Cluster LOD 0

LOD Determined by Query Based on Object Size and Query Distance

Triangle Cluster LOD N

PostgreSQL Rules and Triggers


Select, Update, Delete Rules Do ALSO Command, Command,
Extends SQL operations

Do INSTEAD Command, Command,


Replaces SQL operations

Insert, Update, Delete Trigger Events


Before Event Command Or After Event Command
SQL Views and Rules System hides implementation complexity

Recap
Camera SQL Queries
Selects only whats visible

View coherent queries


Optimizes scene data retrieval for camera motions

2 Level Spatial Indexing


RTree Supports large number of (>100M) objects Z-Ordering improves finer access for large meshes

Spatially Clustered Storage


Optimizes partial mesh access

LOD processing
Optimizes speed versus size for large meshes

PostgreSQL
UDTs and UDF encapsulate functionality in server Rules System hides implementation complexity

Demo

GPGPU ACCELERATION

GPGPU Goals
OpenCL a PostgreSQL Procedural Language
OpenCL Kernels execute as SQL UDFs

Type Mapping, support common data types


Vectors, Arrays, Images

Sorting
Used GPGPU based sorts in SQL queries

WEB 2.0 INTEGRATION

Web 2.0 Goals


Provide a Rich Web 2.0 UI Integration with Web 2.0 Apps Programmability Tracking & Analytics

Rich UI
HTML 5
2D Canvas WebGL Drag & Drop .

Others?
Silverlight for IE9

Web 2.0 Integration


Linking Embedding Social Bookmarking Tagging Drag & Drop Annotations Mash-Ups

Programmable
REST APIs Supports
Browsers & other Web 2.0 Apps

SQL Queries Supports


LAMP, RoR, POJ, ASP.Net,

XML Input / Output support


Document Exchange and Import / Export

JSON Output provides


Easy integration with JavaScript

Tracking & Analytics


Web Browsers

Whos looking at what?


HTTP Server Content Queries

HTTP Request / Response

Logging Service

Log Queries
DBMS

View Web Analytics Reports

Analytics Service

Analytics Report Queries

3D MashUp Service
MashUp Meta Data URI Look-Up Content Filter Transform Clip Merge URI Request

Web Site A
HTTP Request / Response HTTP Request / Response Web Site B

Browser

HTTP Request / Response

URI Request

3D MashUp Engine Acts as Proxy between Browser and Web Sites Filtering, Transforming, Clipping and Merging Content Responses

CONTENT MANAGEMENT

CMS Goals
Track Revisions & Changes
Compare documents Publish Documents Annotation Metadata Queries

Content Versioning
All Database Rows include Version ID Versioning at the File, Section, and Record Levels Rev 0 Rev 1 Rev 2 Rev 3 Rev 4

Rev 1.0

Rev 1.1

Contents Diff
Objects in the database for the 3D content are signed Cryptographically Revision N Diff SHA1 Diff SHA1 Revision M

SHA1

SHA1 Diff Diff SHA1 SHA1 SHA1

SHA1

PERFORMANCE

Performance Challenges
Visual Scenes
20K 5M Polygons

Near Real-Time Queries


Queries 15m 30ms end user response

How much can I retrieve in 16.7 ms?


DB Size < RAM DB Size >= Ram Size && <= 1 T B DB Size > 1 T B

Further Development Areas


Performance Investigations
What are the important queries? Where are the bottlenecks?

Picking Operations
Using a Cylinder to pick from a view

Editing Operations
Updating Geometry

OpenCl as Procedural Language


Allows cleaner OpenCl integration

Summary
Why a 3D in a Database?
Shared Multi-user Scalable Reliable Extensible Secure and well define Security Model Rich Tools Set

Why choose PostgreSQL for 3D


Advanced capabilities Open and Opensource Versatile Simple to use Robust Developer Community Leverages existing skill sets

Q&A

S-ar putea să vă placă și