EXA: The Infinite Instrument

EXA: The Infinite Instrument

评价数不足
Using EXA's In-App Mixed Reality
由 zk 制作
EXA's custom mixed-reality feature projects webcam video onto a plane within the app, removes the green-screen background, and allows the image/video of the player to be illuminated, etc. This guide describes how to enable and configure this in-app mixed-reality feature.
   
奖励
收藏
已收藏
取消收藏
Introduction
EXA's built-in mixed-reality feature brings you into the app itself! This allows your image to be illuminated by the ringer lights, avoids the need to composite mixed-reality layers manually via OBS, and lets you do things like... mixed-reality selfies :)



The light from the ringers really improves the illusion of a player standing in the VR scene.
Getting Started
WHAT YOU NEED

You'll need a few things to use EXA's custom mixed-reality feature. Fortunately, these are mostly the same needs as the "standard" mixed-reality that you get with SteamVR.

  • HTC Vive: This custom mixed-reality feature currently works only with the Vive.

  • Low-latency webcam or camera: The Logitech C922 is often recommended for mixed-reality, and it's the only one that I've tested/used so far (I've found that its standard resolution settings provide the least latency). Low latency is important here, because the video is composited directly into the app -- there isn't currently a way to delay/buffer the app's video/audio to compensate for camera latency.

  • Green screen: This is needed for removing the "background" portions of the video, revealing only the player. It helps to have sufficient lighting, as well, to ensure the entire green-screen has a bright and consistent color. Without a green-screen, EXA's mixed-reality would work a bit differently -- anything "behind" the player's plane would be obscured by the background portions of the video.

  • The "mixedreality.cfg" file: This configuration file tells EXA how to position/align the virtual camera, which Vive controller/tracker to follow, which green-screen colors to remove, etc. See full details below.

  • Vive Tracker (Optional): The easiest way to setup mixed-reality is by attaching your real-world camera to a Vive tracker. The virtual camera can then follow the Vive tracker, which ensures that the virtual and real-world cameras are aligned with each other.

SEE IT IN ACTION

The first three minutes of this video provide a visual overview of how this mixed-reality feature looks and operates. It shows how the video can be illuminated by the lights in the scene, how the "video plane" is placed into the scene, and how you can see yourself within the app via the mixed-reality monitor/mirror.

Configuration File
Place the mixedreality.cfg file in the EXA install folder (next to EXA.exe).

Here are example contents of the mixedreality.cfg configuration file:

camera.device = 0 camera.fov = 43.33333333 camera.fps = 59.94 camera.resolution.vertical = 0 camera.resolution.ratio = 1.33333333 camera.monitor.scale = 2 camera.monitor.plane = 1 camera.offset.px = 0 camera.offset.py = -0.04 camera.offset.pz = 0.04 camera.offset.rx = 90 camera.offset.ry = 0 camera.offset.rz = 0 vr.device = 5 vr.offset.px = 0 vr.offset.py = 0 vr.offset.pz = 0 vr.offset.rx = 0 vr.offset.ry = 0 vr.offset.rz = 0 image.cutout.hue.min = 0.25 image.cutout.hue.max = 0.5 image.cutout.chroma.min = 0.1 image.cutout.chroma.max = 1 image.cutout.value.min = 0.1 image.cutout.value.max = 1 image.cutout.edge = 0.04 image.crop.l = 0 image.crop.r = 0 image.crop.t = 0 image.crop.b = 0 image.brightness = 0.25
Configuration Details
CAMERA

The camera settings are related to the alignment of the virtual camera to the real-world webcam and the webcam's hardware settings.

camera.device
The index of the webcam device in the list of available devices. Use the 'C' key to cycle through the available webcam devices at runtime.
camera.fov
The FOV of the webcam. Use the same value as you would for the SteamVR "fov" setting.
camera.fps
The frames-per-second to request from the webcam. This is ignored if a vertical resolution of 0 is provided.
camera.resolution.vertical
The vertical resolution to request from the webcam. Set this to 0 to use the webcam's default resolution (which may provide the lowest webcam latency).
camera.resolution.ratio
The aspect ratio to request from the webcam. If the vertical resolution is set to 0, this value should represent the ratio of the webcam's default resolution (otherwise, the video will appear stretched incorrectly in the app).
camera.monitor.scale
The relative size of the mixed-reality "monitor" (or "mirror") that appears in the app. This shows the user exactly what the final mixed-reality result looks like, allowing the user to compose their mixed-reality shots and ensure everything is in frame.
camera.monitor.plane
Set this to 1 to see the 3D plane that displays the webcam video. This allows the player to look down and see their real arms and legs (which will be flattened and potentially at a strange angle). Use a value of 0 to hide this plane from the user.
camera.offset.px / py / pz
The positional offset (in meters) between the center of the Vive device and the lens of the webcam.
camera.offset.rx / ry / rz
The rotational offset (in degrees) between the direction of the Vive device and the direction of the webcam lens.

VR

The vr settings choose a specific Vive device to follow, and can shift the entire scene. This shifting is an effect similar to teleporting, since it changes the origin of the scene. This is useful if your camera is in a fixed position, and you want to move everything in the scene towards or away from it.

vr.device
The index (0 to 15) of the Vive device (tracker, controller, etc.) that the virtual camera will follow. When a third Vive tracker or controller is added, typically it will use index 5. Use the 'D' key to cycle through the Vive devices at runtime.
vr.offset.px / py / pz
The amount to shift the entire VR space, relative to the origin.
vr.offset.rx / ry / rz
The amount to rotate the entire VR space, relative to the origin. This is an effect similar to teleporting, which changes the origin of the scene.


IMAGE

The image settings tell the app how to process the webcam video, including the removal of the green-screen background. Note: for a pixel to be removed, its color/values must fall within all of the provided "cutout" ranges (hue, chroma, brightness).

image.cutout.hue.min / max
The range of hue (0 to 1) that a pixel must have to be removed.
image.cutout.chroma.min / max
The range of chroma (0 to 1) that a pixel must have to be removed. You can think of "chroma" as being similar to the saturation or colorfulness of a pixel.
image.cutout.value.min / max
The range of value/brightness (0 to 1) that a pixel must have to be removed.
image.cutout.edge
Extends the above "cutout" ranges by the specified amount. Essentially, this finds the edges around the cutout shapes, and removes their green tint.
image.crop.l / r / t / b
The relative amount of crop/removal (0 to 1) extending from the left, right, top, and bottom edges of the video. This is useful if the green-screen doesn't fully cover some portion at the edge of the video frame.
image.brightness
The amount of brightness (0 to 1) to apply to the video image. For EXA, a lower value (like 0.25) works well, because the VR space itself is dark, with low lighting.
Shortcuts / Tools
CYCLE WEBCAM DEVICES

Hit the "C" key to cycle through all the available webcam devices. The device index and name will appear on-screen. Once you find the one you want, you can update the mixedreality.cfg file with the correct device index.

CYCLE VIVE DEVICES

Hit the "D" key to cycle through all possible Vive devices (with indexes 0 to 15). The device index will appear on-screen. Once you find the one you want, you can update the mixedreality.cfg file with the correct device index.

ALIGNMENT MODE

Hit the "A" key to toggle the "alignment" mode. When this mode is enabled, squeeze the "grip" buttons on the right Vive controller. While squeezed, rotate the controller to fine-tune the rotational offset (the camera.offset.r* values).

It's best to rotate the controller on one X/Y/Z axis at a time. This isn't very intuitive, so it will probably take a moment to figure out how controller rotation translates to "camera.offset" rotation.

Each time you release the "grip" buttons, EXA prints the new "camera.offset" values to its debugging log. Starting in the same folder as the configuration file, you can find this log in the EXA_Data/output_log.txt file. You can update the mixedreality.cfg file with the new offset values.