We’re excited to announce support for VR in ROBLOX! This is a very early preview that makes it possible to adapt the games to work in VR. It’s mainly targeted at developers - a lot of product features (like play loop, platform integration etc) are missing.
Platforms
We currently only support Oculus Rift devices (namely, DK1 and DK2). To make it work, just install Oculus 0.8 Runtime from https://developer.oculus.com/downloads/pc/0.8.0.0-beta/Oculus_Runtime_for_Windows/.
While our intention is to eventually support all major VR platforms/devices, we have not yet settled on the release platform(s). Treat this as a development preview, not as a product.
How to enable VR
VR is enabled as long as you have a compatible device:
-
Whenever you play a game on ROBLOX on PC, we automatically activate VR if you have Oculus Rift plugged in and powered on
-
Whenever you use Play Solo in ROBLOX Studio, we automatically activate VR as well. Studio server/client mode currently does not use VR.
As we develop VR support further we are considering adding VR as another formfactor, similar to tablet/phone/desktop. For now it’s lumped in with desktop.
If you don’t want to play or test in VR, just power your Rift off (or unplug).
Due to some compatibility issues with Oculus Runtime in some cases it may hang the client; usually to solve this you have to restart Oculus Runtime.
Content
In VR the most important part is having most of your content in 3D. We are not ready right now to provide guidelines on what works well and what does not - in part we expect you to help us figure it out, however one significant itme would be to minimize or eliminate your usage of 2D UI. In VR we display your 2D UI in the center of the screen so that all control elements are not in your peripheral vision, but the details of how we handle 2D UI may change.
Both SurfaceGUI and BillboardGUI work fine in VR so you should use them. We currently have player names hidden in VR but we’ll fix this in upcoming releases.
We currently have neon, water reflections and SSAO disabled in VR - instead we force enable MSAA. Support for these effects in VR will be restored (also next week MSAA in VR will scale with the quality level).
API
While we’re still fleshing out the details of working with cameras in VR in ROBLOX, the basic element you should have is using the tracking data from the VR headset (position and orientation, essentially) to control the camera. To do that we expose these APIs:
bool UserInputService.IsVREnabled
This is true if your game is running in a VR environment; you could use this to disable certain control elements that are problematic in VR
CFrame UserInputService.UserHeadCFrame
This is the CFrame containing head position/orientation data, with the origin being the “resting head” position - you can reset the origin in Oculus Debug Utility.
We’re working on adding code that uses these APIs to builtin camera/character control scripts. For now you could just use the head CFrame transformation for your camera, e.g.:
local vrframe = game:GetService("UserInputService").UserHeadCFrame
workspace.CurrentCamera.CoordinateFrame = basecameracframe * vrframe
(assuming basecameracframe is constructed using inputs from controller)
Please note that the API is experimental. If we need to change the API we will provide limited compatibility by deprecating the old API and creating new API, but the deprecated VR APIs will be removed at some point before official launch. Of course you’ll be notified of all API changes.
Controls
Currently the most natural device for VR is the gamepad - it’s easy to locate gamepad buttons with your hands without taking the headset off. However, keyboard/mouse can also work well in some cases - we encourage experimentation. You should also read this https://developer.oculus.com/documentation/intro-vr/latest/concepts/book-bp/ for some information that was gathered by Oculus during their testing.
Performance
One final important criteria for VR is performance. Desktop VR devices that are shipping this year are targeting 90 Hz refresh rate; since we have to render the scene twice this puts additional pressure on the graphics card and our rendering subsystem. On mobile you still need to maintain 60 Hz and the device is way slower. All of this means that performance will be very important for VR.
We’re doing a lot of work on our side - some of the performance improvements are already in the shipping stage, and some are planned. This includes all systems - physics/rendering/sound/etc. However, we’ll also expect the developers of games to be aware of performance issues and anti-patterns - expect to hear more performance-related discussions and guidelines from us in the future.
In addition to that, of course you need a reasonably powerful PC. ROBLOX VR will work well on PC on systems that are not “Oculus-ready” performance-wise, but the quality of your experience will directly depend on your CPU and GPU.
When?
All of the above is already live on desktop client and Studio - so if you happen to have a DK1/DK2 or a friend who has one, you can start now! We will ship incremental updates that enhance built-in systems with better VR support, add new APIs for VR-compatible games to use, optimize client with VR in mind, etc. Interestingly, most of the optimization work benefits us across the board - VR just sets a much higher bar in terms of performance, but it’s not that unique otherwise.
Can’t wait to see what you come up with!