CDC/CRA CHiPs Mentoring Workshop High Performance Interconnects
Wonderland CHIPS Workshop June 2009
-
Upload
jonathankap -
Category
Technology
-
view
935 -
download
3
description
Transcript of Wonderland CHIPS Workshop June 2009
Project WonderlandDeveloper Workshop
Jonathan Kaplan
Sun Microsystems Laboratories
2Copyright 2009, Sun Microsystems, Inc.
What is Project Wonderland?
100% Java, free, open-source toolkit for creating 3D immersive virtual worlds
3Copyright 2009, Sun Microsystems, Inc.
Video Demo
4Copyright 2009, Sun Microsystems, Inc.
Motivation• Improve business collaboration
and distance education• Immersion enhances
business and edu collaboration> Multiple simultaneous
conversations crucial for informal interaction
> High emotional / social bandwidth > Increases sense of presence> 3D space provides context for learning and collaboration> 3D space helps define culture> Collaboration is the norm
5Copyright 2009, Sun Microsystems, Inc.
Use the Toolkit to Build Worlds for...
Collaboration with Live DocsCollaboration with Live Docs
3D Data Visualization and Analysis3D Data Visualization and Analysis
Training, SimulationTraining, Simulation
Teaching, LearningTeaching, Learning
Integrating with Real WorldIntegrating with Real World
6Copyright 2009, Sun Microsystems, Inc.
Virtual Northstar – St. Paul College
7Copyright 2009, Sun Microsystems, Inc.
Engineering Team RoomWorcester Polytechnic Institute (WPI)
HTML Viewer
WonderBlocks
8Copyright 2009, Sun Microsystems, Inc.
Use the Toolkit to Build Worlds for...
Collaboration with Live DocsCollaboration with Live Docs
3D Data Visualization and Analysis3D Data Visualization and Analysis
Training, SimulationTraining, Simulation
Teaching, LearningTeaching, Learning
Integrating with Real WorldIntegrating with Real World
9Copyright 2009, Sun Microsystems, Inc.
Glasshouse – Green Phosphor
10Copyright 2009, Sun Microsystems, Inc.
Molecule Visualization – Free University, Berlin
11Copyright 2009, Sun Microsystems, Inc.
ProjectVS – Applied Minds
12Copyright 2009, Sun Microsystems, Inc.
Use the Toolkit to Build Worlds for...
Collaboration with Live DocsCollaboration with Live Docs
3D Data Visualization and Analysis3D Data Visualization and Analysis
Training, SimulationTraining, Simulation
Teaching, LearningTeaching, Learning
Integrating with Real WorldIntegrating with Real World
13Copyright 2009, Sun Microsystems, Inc.
Virtual Academy - VEGA
14Copyright 2009, Sun Microsystems, Inc.
Use the Toolkit to Build Worlds for...
Collaboration with Live DocsCollaboration with Live Docs
3D Data Visualization and Analysis3D Data Visualization and Analysis
Training, SimulationTraining, Simulation
Teaching, LearningTeaching, Learning
Integrating with Real WorldIntegrating with Real World
15Copyright 2009, Sun Microsystems, Inc.
MiRTLE – University of Essex
16Copyright 2009, Sun Microsystems, Inc.
iSocial – University of Missouri
17Copyright 2009, Sun Microsystems, Inc.
Use the Toolkit to Build Worlds for...
Collaboration with Live DocsCollaboration with Live Docs
3D Data Visualization and Analysis3D Data Visualization and Analysis
Training, SimulationTraining, Simulation
Teaching, LearningTeaching, Learning
Integrating with Real WorldIntegrating with Real World
18Copyright 2009, Sun Microsystems, Inc.
6th Space - Malden Labs
19Copyright 2009, Sun Microsystems, Inc.
6th Space – Malden LabsMonitoring Data Center with Sun SPOTs
Sun Small Programmable Object Technology (Sun SPOT)
20Copyright 2009, Sun Microsystems, Inc.
Sapienza University / SunControlling Wonderland Worlds with Sun SPOTS
21Copyright 2009, Sun Microsystems, Inc.
Music In Wonderland
22Copyright 2009, Sun Microsystems, Inc.
Vision• 3D Web
> Federated, specializedvirtual worlds
> Common way to express behavior across platforms(Java mobile code)
23Copyright 2009, Sun Microsystems, Inc.
Differentiators
• Architectural> Highly extensible via modules> Internal or external deployment> Federated & secure> Open - 100% Java, open
source, open art path
• End User> Shared applications> Integration with
business/web data> Audio as core feature> Telephony integration
24Copyright 2009, Sun Microsystems, Inc.
Wonderland Status
2007 2008 2009
Start v0.3 v0.4
• Started with a challenge from VP of eco responsibility• Demo of virtual Sun office (MPK20) at JavaOne '07• Added features to “demo” code base through version 0.4• Currently working on completely re-architected version 0.5
> Monthly developer releases> End user release expected in fall '09
Start Demo @ JavaOne
v0.3 v0.4v0.5dev1 v0.5
2010
25Copyright 2009, Sun Microsystems, Inc.
What's in Wonderland v0.5?
• Core features from v0.4> Application Sharing
• Unmodified X11 application and collaboration-aware Java applications
> Immersive Audio• Includes mix of recorded and live audio, range
of audio fidelities, individual volume control, audio recording, and audio applications suchas the virtual microphone and cone-of-silence
> Telephone Integration• Includes dial-in, dial out, and connecting
avatars with telephone audio
• Lots of new features...
26Copyright 2009, Sun Microsystems, Inc.
Updated Graphics and Avatars
• MTGame Graphics System> Based on jME
(jMonkeyEngine)> Adds threading and
process model
• Avatar System> Bone models> Skinning> Customizable animations
(requires Maya)> Limited posing
27Copyright 2009, Sun Microsystems, Inc.
Modules
• Mechanism for packaging & sharing Wonderland extensions> Can contain code, artwork, audio,
scripts, web management and web services> Also world configurations for sharing whole worlds> Deliver art assets via embedded HTTP server> Packaged as archive (jar) files
• Modules can depend on other modules
• Web-based UI for installation and administration
ModuleModule
CodeArtworkScripts
Assembled worldsOther resources
28Copyright 2009, Sun Microsystems, Inc.
World Assembly• Open art path
> Import Collada 3D models> Uses industry-standard tools
• Photoshop, GIMP• SketchUp, Maya, Blender
> Direct import of .kmz models created with Google SketchUp
• Dynamically add content (eg, microphone, Firefox browser) to world using a palette
• Move, resize, and scale cells using in-world tools
29Copyright 2009, Sun Microsystems, Inc.
Other New Features• Embedded Swing
> For in-world applications> HUD development
• Drag-and-Drop> Mime-type scheme> Application launches on drop
• Web-based management> Manage modules > Create snapshots> Monitor server> Access content repository
30Copyright 2009, Sun Microsystems, Inc.
New Features, cont.
• Scripting> Language-independent
support based on Javascripting standard (JSR 223)
> Language-dependent support for more complete integration
• Security> Control access to individual objects and spaces> Integrate with standard identity management solutions
• Content repository and simple document management> WebDAV integration> Stores scripts, 3D models, shared application data
31Copyright 2009, Sun Microsystems, Inc.
Demo
See video demo here:http://www.youtube.com/watch?v=-ITA8Pags4g&fmt=18
32Copyright 2009, Sun Microsystems, Inc.
Version 0.5 Architecture Overview
• Client > Designed as browser for
Wonderland worlds> Each world has different
content and behavior> Client downloads content and code
when connecting to a server
• Server > Set of independent applications managed by a web server
• Federation> “Web-server model”
33Copyright 2009, Sun Microsystems, Inc.
Wonderland 0.5 Software Stack
Darkstar Server
Voice Bridge
Shared App Server
Chat Server
Client
Server ● Web Server manages services:● External processes (shown right)● World assets● Module-based extensibility● Security● Web Management UI● Shared resources for federation
ExternalServices
● Identity services● Asset repositories
● Real-time telemetry● Hosting / world management
● Multithreaded 3D graphics ● Advanced avatar system● Immersive audio● Scripting support
● Virtual world browser● 100% Java● Open art path● Shared applications
34Copyright 2009, Sun Microsystems, Inc.
Networking Scheme
Embedded Web/Application server
Module/CodeStore
WorldBackup
WebDAV/Content
RESTful Web Service API
ServerStart/Stop
Web-based Management
Application Nodes
Darkstar Server
Node(s)
Voice Bridge
X11 Shared App Server
WonderlandClient
WonderlandClient
WonderlandClient
WonderlandClient Internet
35Copyright 2009, Sun Microsystems, Inc.
Federation
WonderlandClient
Internet
Standalone Server
Module/CodeStore
World 1
Identity
Voice
Apps
Presence
Server Cluster
Module/CodeStore Identity
Voice AppsPresenceSharedServices
Server
World 2
Server
World 3
Server
World 4
Standalone Server
Module/CodeStore
World 5
Identity
Voice
Apps
Presence
WonderlandClient
WonderlandClient
WonderlandClient
36Copyright 2009, Sun Microsystems, Inc.
Wonderland Server• Multiple services
> Single-sign on across services
• Web server for management> Based on embedded Glassfish
• Darkstar server for “live” state• jVoiceBridge for audio mixing• Other services can be added
> Shared app server> XMPP chat server
Wonderland Server
Data /ModuleStore
Web Server
Apps
Darkstar
...
Voice
Identity
37Copyright 2009, Sun Microsystems, Inc.
Project Darkstar Game Server
• Open source, enterprise-grade server infrastructure> For games and virtual worlds
• Simple and familiar Java programming model> Looks like single thread, single machine
• Designed for scalability (no “sharding”)> Task scheduling part of the infrastructure> Concurrency control through the data store, transactions> Computation can occur on any machine> Machines can be added (or subtracted) at any time
• Extensible set of services
38Copyright 2009, Sun Microsystems, Inc.
Darkstar Scalability
39Copyright 2009, Sun Microsystems, Inc.
Project Darkstar Programming Model• Tasks
> independent, short lived> transactional – either everything is done or nothing is
• Data> data service detects conflicts, changes> if two tasks conflict: one will commit/complete, and one will
abort and be rescheduled
• Communications> client sessions (client to server)> channels (publish/subscribe client/server-to-client) > actual communication only happens on commit
40Copyright 2009, Sun Microsystems, Inc.
jVoiceBridgeEnables Audio as a Core Feature• Features
> Standards-based (IP, NIST SIP, & RTP)> Hybrid VoIP / PBX system> Fidelity ranges from telephone to
CD quality
• Enables> Immersive audio> Telephone integration> Individual volume control> Ability to mix recorded and live audio > Audio applications> Audio capabilities applied to objects
41Copyright 2009, Sun Microsystems, Inc.
Wonderland Client • Virtual world “browser”• State-of-the-art 3D rendering
> MT Game / jMonkeyEngine
• Provides core client APIs> Cells, world management> Visual: rendering, HUD, avatars> Utility: events, security, physics, collision, ...
• Extensible with new cell types, plugins
Wonderland Client
MT Game
Communications
JMonkeyEngine
CellAvatars HUD
Scripting
SecurityDnD Input/Events
Collision Physics
42Copyright 2009, Sun Microsystems, Inc.
MTGameGraphics Rendering Framework for Wonderland
• High-performance 3D rendering engine> Designed to scale on multi-core/multi-threaded clients> Presents single-threaded programming model to
developers> Support for advanced shaders and
rendering techniques> Based on open source jMonkeyEngine> Model import via Collada
• Highly Extensible• Per-object behaviors• Pluggable collision and physics systems
43Copyright 2009, Sun Microsystems, Inc.
Enables High-Quality Graphics
Shadows, reflections, textures, portals, and high-quality avatars
44Copyright 2009, Sun Microsystems, Inc.
Extending Wonderland
• Custom cells> “Objects” in the world
• Cell components> Capabilities to add to any cell
• Custom connections> Send / receive non-spatial data
45Copyright 2009, Sun Microsystems, Inc.
Cells
• World is divided into discrete volumes called “cells”• Cells are nested into a tree structure• Cell tree divides 3D scene into network-sized chunks
RoomCell AppCell
AvatarCells
TeapotCell
WorldRootCell
46Copyright 2009, Sun Microsystems, Inc.
Cell Trees are copied on each client
TeapotCellMO
TeapotCell
Server
Sally
Jessy
Raphael
TeapotCell
TeapotCell
On connecting to the server, clients create a local hierarchy of cell objects that mirror the server objects
47Copyright 2009, Sun Microsystems, Inc.
Server Client jME
Creating Custom Cells• Client behavior in Cell
> Bounds, rendering
• Server behavior in CellMO> Synchronization, persistence
• Communicate via Messages
Teapot
Server CellMO
Teapot
Client Cell
Teapot
Cell RendererMessages
48Copyright 2009, Sun Microsystems, Inc.
TeapotCellMO – state managementpublic class TeapotCellMO extends CellMO {
// state storage private Color color;
// required constructor public TeapotCellMO(CellID cellID, CellCache cache) { super (cellID, cache); }
// corresponding client state public String getClientCellClassName(WonderlandClientID id, ClientCapabilities capabilities) { return "org.wonderland.modules.shape.client.ShapeCell"; }
// synchronize when the client connects public TeapotClientState getClientState();
// long-term storage as XML public TeapotServerState getServerState(); public void setServerState(CellServerState state);}
49Copyright 2009, Sun Microsystems, Inc.
About state management
• “Live” state on the server> Serializable objects stored in Darkstar datastore
• Synchronized with a client> Send the client a CellClientState object on client connect> Afterwards, send messages to maintain state
• Long-term storage as XML files> CellServerState object can be represented as XML
XML File
CellServerState
Serialized object
CellMO
Serialized object
CellClientState
Java object
CellMessage
50Copyright 2009, Sun Microsystems, Inc.
TeapotCellMO – communicationspublic class TeapotCellMO extends CellMO { @UsesCellComponentMO(ChannelComponentMO.class) private ManagedReference<ChannelComponentMO> channel;
// sign up for messages public void setLive(boolean live) { channel.get().addMessageReceiver(TeapotMessage.class, receiver); }
// message handler object private static class SharedMessageReceiver implements ComponentMessageReceiver, Serializable { public void messageReceived(WonderlandClientSender s, WonderlandClientID id, CellMessage message) {
TeapotMessage message = (TeapotMessage) message; cellRef.get().setColor(message.getColor()); } }}
51Copyright 2009, Sun Microsystems, Inc.
Teapot communicationspublic class TeapotCellClientState extends CellClientState { private Color color;
// no-arg constructor public TeapotCellClientState() {}
// getters and setters public Color getColor(); public void setColor(Color color);}
public class TeapotCellMessage extends CellMessage { private Color color;
// no-arg constructor public TeapotCellMessage() {}
// getters and setters public Color getColor(); public void setColor(Color color);}
52Copyright 2009, Sun Microsystems, Inc.
TeapotCellpublic class TeapotCell extends Cell { Private Color color; private ShapeCellRenderer renderer = null;
// required constructor public TeapotCell(CellID cellID, CellCache cellCache) { super(cellID, cellCache); }
// set our state from the client state public void setClientState(CellClientState state) { super.setClientState(state); this.color = ((TeapotCellClientState)state).getColor(); }
// create a renderer protected CellRenderer createCellRenderer(RendererType type) { if (rendererType == RendererType.RENDERER_JME) { return new TeapotCellRenderer(this); } return super.createCellRenderer(type); }}
53Copyright 2009, Sun Microsystems, Inc.
TeapotRendererpublic class TeapotRenderer extends BasicRenderer { public TeapotRenderer(Cell cell) { super(cell); }
protected Node createSceneGraph(Entity entity) { String name = cell.getCellID().toString(); TriMesh mesh = new Teapot(name);
// set the color Color color = ((TeapotCell) cell).getColor(); mesh.setDefaultColor(new ColorRGBA(color.getRed(), ...));
// create a node in the scene graph Node node = new Node(); node.attachChild(mesh); node.setModelBound(new BoundingBox()); node.updateModelBound(); node.setName("Cell_" + name);
return node; }}
54Copyright 2009, Sun Microsystems, Inc.
Other Stuff
• CellFactory> Create the cell from the cell palette
• CellProperties> Adjust the cell from the UI
• Events / input> Handle mouse clicks or other events
• Server state> Serialize to XML
55Copyright 2009, Sun Microsystems, Inc.
Cell Component
• Add a capability to any cell• Can be dynamically added or removed• Client and server code (just like a cell)• Access to other components in the same cell• For example:
> Channel> Audio> Metadata> Security
CellAudioComponent ChannelComponent SecurityComponent
CellMO
AudioComponentMO ChannelComponentMO SecurityComponentMO
56Copyright 2009, Sun Microsystems, Inc.
Creating a Cell Component
• Just like creating a cell> CellComponent, CellComponentMO> CellComponentClientState, CellComponentServerState> Messages> CellComponentFactory, CellComponentProperties
• Add a component to a cell> Identified by Java type> Dynamically using the UI> Programatically
57Copyright 2009, Sun Microsystems, Inc.
Injecting cell components
• Cells and components can refer to other components
• Automatic creation and injection makes it easier• Cell (or CellComponent)
• CellMO (or CellComponentMO)public class TeapotCellMO extends CellMO {
@UsesCellComponentMO(ChannelComponentMO.class) private ManagedReference<ChannelComponentMO> channel;
public class TeapotCell extends Cell {
@UsesCellComponent private ChannelComponent channel;
58Copyright 2009, Sun Microsystems, Inc.
Custom Connection
• For communicating non-spatial information• Add functionality to existing client or create a
standalone client• For example
> Text chat> Presence> Server performance> NPC controller> Sensor integration
ClientTextChatConnection
Server
TextChatConnectionHandler
59Copyright 2009, Sun Microsystems, Inc.
Creating a Custom Connection
• On the client> CustomConnection extends BaseConnection> BaseConnection provides messaging> Provides API that uses messages
• On the server> CustomConnectionHandler implements
ClientConnectionHandler> Notification when message is received> Send messages back to clients> Access to all Darkstar data and services
60Copyright 2009, Sun Microsystems, Inc.
Modules
• Mechanism for sharing Wonderland extensions> Can contain code, artwork, audio, scripts, web
management and web services> Also world configurations for sharing whole worlds> Deliver art assets via embedded HTTP server> Packaged as archive (jar) files
• Modules can depend on other modules
• Web-based UI for installation and administration
61Copyright 2009, Sun Microsystems, Inc.
Wonderland Ecosystem
Client
Web Server
Darkstar Server
Voice Bridge
Shared App Server
Chat Server
3D Engine
Asset Management
Modules Security
Avatars
Monitoring & Management
Art Import
Scripting
Art Tools(Maya, Blender, Sketchup, Softimage)
Art Warehouse(Google 3D warehouse,other art repositories)
External Data(Sensors, telemetry,web services)
Authentication / Authorization(OpenSSO, Java.net, custom integrations)
Systems Management(Deployment management,Performance monitoring)
Economy(Micropayment providers,inventory management)
Learning Management Systems
(Class content integration,login integration)
Software Development(Netbeans plugin, ...)
Asset Repositories(WebDAV, module storage,
artwork, video)
Storage
Avatar Tools(3rd party avatar designers,
custom graphics, accessories, animations)
Engine Extensions(AI, physics, ...)
Services(Software distribution,
hosting, world creation)
62Copyright 2009, Sun Microsystems, Inc.
Getting Started with Wonderland
• Today> Download code from subversion:
# svn co https://wonderland.dev.java.net/svn/wonderland/trunk
> Build and run with ant> See tutorial
• Soon> Download binary from http://projectwonderland.com> Binary is for the server, clients use Java Web Start
• Frequent developer releases
63Copyright 2009, Sun Microsystems, Inc.
Wonderland client launch
64Copyright 2009, Sun Microsystems, Inc.
Wonderland Web Administration
65Copyright 2009, Sun Microsystems, Inc.
Technical Requirements
• Scales up and down> Run entire system on a laptop
• Linux, Windows, Mac, Solaris• Java 6• Client: 3D accelerated graphics
> OpenGL 2.0> ATI or nVIDIA
• Server: Unix for application sharing> Linux or Solaris, works without apps on other platforms
66Copyright 2009, Sun Microsystems, Inc.
ProjectWonderland:
Call toAction
• Join the Ecosystem> Offer a Wonderland service> Create & distribute modules
• Become a developer> Plenty of project ideas> Active open source community
• Create artwork> SketchUp makes 3D content
creation accessible to everyone
• Create your own world!
67Copyright 2009, Sun Microsystems, Inc.
Project Wonderland Resources• Open Source Project Site
> http://ProjectWonderland.com> Download: binary, source code, examples> Learning: architecture, roadmap, FAQ > Community: latest news/blogs, forums, mailing lists> Tutorials, technical articles, troubleshooting> Suggestions for student projects
• WonderBlog - Official Wonderland Blog> http://blogs.sun.com/wonderland
• Sun Immersion Special Interest Group> http://sun-isig.ning.com> Social network for Wonderland interest
[email protected]@sun.com