This package enables networked VR experiences on an OpenACS installation. It is somewhat similar to Mozilla Hubs in spirit, based on A-Frame and inspired by Networked-Aframe.
Hubs is great and mature, but also quite complex. The process to host an own installation is not straightforward because it depends on many tools and subsystems.
To make matters more complicated, in February 2024 Mozilla has discontinued new development on the product, just a few months after embarking in a complete rewrite of the client code.
Although there is overlapping both in terms of features and technology with Hubs, the focus of this implementation is on keeping it simple: NaviServer does the Websocket stuff needed to move things around on the scene and Janus does the WebRTC stuff for multimedia. This VR you can definitely host on premise! ;-)
Users can create their avatar via the user interface provided by ReadyPlayerMe. Currently, half-body avatars without hands are supported.
Once your half-body avatar is ready, you can copy/paste the generated link in the user interface available under "Manage Avatar" on the main package page.
The system will take care of downloading the right model without hands and will also generate a thumbnail for you using the ReadyPlayerMe API.
The hands are currently represented for every users the same using the default models provided by A-Frame's hand-controls component.
We track position, rotation and gestures of your hands so you can interact with your buddies.
Powered by aframe-htmlmesh, this menu works both in VR and on desktop. Depending on the features enabled in your experience, it allows to check information, spawn objects, enter/exit immersive mode and much more.
When using a headset, blink-controls allow to move around without walking.
This component also supports navmeshes.
When a properly configured janus-gateway and multistream videoroom plugin is available, we can provide audio chat to converse with other participants.
Some environments will also expose surfaces that can be used to stream content (e.g. a cinema screen). Any media one can stream via WebRTC can be streamed on these surfaces via the "Stream to Room" functionality on the main package page.
In the VR menu, we provide the UI to mute/unmute, check our own volume and enable push-to-talk.
Depending on your client (headset or desktop), you will be able to interact with entities in the room together with your friends.
You will be able to:
- upload custom .glb/.gltf models
- spawn of .glb/.gltf models via UI in the networked experience
- grab objects
- increase/decrease the scale of objects, either via moving the thumbstick on the hand that is grabbing the item, or by grabbing with two hands and extending/reducing the distance between the two hands.
When the environment is configured accordingly, the objects will also behave according to physics, e.g. will fall on the floor, slide down ramps, bump against walls and so on.
When the OpenACS chat package is available, a chat will be displayed in the menu allowing users to converse with each other, by specifying a chat room id in the configuration parameters of your VR experience.
When using a headset is currently only possible to reply to the chat while outside of immersive mode.
Based on a fork of the excellent A-Painter, we allow peers to paint collaboratively in the experience. This can be used for art or as a communication tool.
Based on a custom build of the gltf-model-plus component, it is possible to load scenes created for Mozilla Hubs as environments for your experience.
There are limitations to what we can support out fo the box, but things that will work include lightmaps, spawn points, particle effects and animations.
See the mozilla-atrium or the outdoor-festival environments for an example of models from Mozilla Hubs in action.
The package provides common features and boilerplate for different VR use cases such as videoconference, casual chat and lectures. The actual looks of the space where your experience will take place is defined by the "environments".
We currently provide 5 environments out of the box:
- default - A simple vaporwave space with a couple of cinema screens. A simple flat sufface that can potentially accomodate larger groups.
- ada-venue - A model taken from the excellent aframe-xr-boilerplate. This environment showcases a physics-enabled building with uneven multi-level floor and a navmesh. It comes with a ball that will roll around and can be picked and played with by participants. Models spawned in this environment will also be subjected to gravity. A cinema screen is available.
- cuddillero-diorama - From the famous Cudillero Diorama model on MozillaHubs, this model has a complex navmesh and uses multiple spatial audio sources to recreate that vacation feeling.
- mozilla-atrium - Another Mozilla Hubs model, suitable for casual meetups. It showcases the use of the gltf-model-plus component to load models exported from Spoke.
- outdoor-festival - Another Mozilla Hubs model, showcasing a big outdoor space with particle effects, sound effects and animations loaded from the model.
These examples can also be used as a reference to provide new ones.
- better avatar integration (use native model hands, support full body avatars, follow sound with eyes...)
- "application based" server-side validation of the networked actions. This makes it currently unsuitable for "low trust" scenarios such as competitive games
- jumping?
- ...
To have OpenACS running on your machine, follow the instructions at https://openacs.org/xowiki/naviserver-openacs
In your OpenACS packages folder:
cd /<your-openacs-path>/packages/
git clone https://github.com/Elettrotecnica/aframe-vr.git
Then on a browser:
- Go to the homepage of your server
- Log in as administrator
- Click on "Install more packages"
- In the section "Install from Local File System", click on Install
- Select aframe-vr for installation
- In the next page, click on "Install packages"
- Restart your instance
The package can be instantiated multiple times. Each instance carries its own parameters and configuration, so it is possible to host different kinds of experiences and to target different user groups.
In order to support streaming multimedia content to the VR experience and audio chat among peers, we integrate with Janus WebRTC Server.
Follow the intructions at https://github.com/meetecho/janus-gateway and ensure that the (multistream) VideoRoom plugin is enabled.
aframe-vr will automatically require a Janus video room for every mounted package instance that is configured to utilize WebRTC. The room can also be configured in advance in case we do not want or cannot create rooms dynamically. See the "Room Settings" page of any package instance and refer to the code in janus-videoroom-procs.tcl and room-procs.tcl for more information.