Config Files
ViewR mod uses two config files in the root folder of to configure how it works. This will guide you through what each component does.
viewrcamera.cfg
This file configures how the modded camera behaves.
The camera cfg for superhot is shown below.
(float) x, y, z, rx, ry, rz
This is the physical offset of the tracker, if you have one attached to your device. These values will be ignored if you use an inside out tracking system for your device like ARCore.
(float) poslerp, rotlerp
These values determine how much smoothing is applied to your camera. Trackers tend to be jittery when recording moving footage, and thus, these values make the stream smoother to watch from the device. Setting these values to 0 will turn off any smoothing. Smaller values will result in a smoother but laggier stream.
(float) fov
Field of view of the recording camera. Changing this value will not change the field of view of the stream on your device.
(string[]) originname
The ViewR Interface object in Unity is designed to detect an origin if it's not specified explicitly by the game. The origin is the playspace which the player exists in. ViewR Interface will use the name here to Find() the object. This value is a comma separated list, and will cause ViewR Interface to search for those names in the specified order when it loses its origin.
(string[]) targetname
The ViewR Interface object in Unity is designed to detect an target if it's not specified explicitly by the game. The target is the player's headset object. ViewR Interface will use the name here to Find() the object. This value is a comma separated list, and will cause ViewR Interface to search for those names in the specified order when it loses its target.
(string[]) targetcamera
This is the object that holds the camera that ViewR will copy if it needs to copy a camera when a device connects. If the name is "Camera.main", ViewR will use the Camera.main object in Unity. This value is a comma separated list, and will cause ViewR Interface to search for those names in the specified order when a device connects.
(string[]) camerabehaviourfilter
These are behaviors to be stripped off the ViewR Camera object when it's cloned from the target camera. A good example of this is the MonoBehaviour on SuperHot's main camera, that causes time to move when the headset moves. We really don't need that on the spectator cameras, so it's removed by this value on instantiation. This value is a comma separated list.
(int[]) cullinglayerstoadd
These are culling layers to add to the created camera. We do this because sometimes, culling layers need to be added. eg. ViewrAvatar puts the avatar on a layer that's not shown by the main camera so that the player can't see the avatar overlaying everything, but for the spectators, we need to re add the layer that was removed. This value is a comma separated list.
(int[]) cullinglayerstoremove
These are culling layers to be removed from the created camera. We do this because sometimes there's things we don't want the spectator to see. For example, in modded beatsaber, layer 4 needs be removed as it's the first person view objects, and we don't need 2 of everything. This value is a comma separated list.
(bool) allowhdr
This turns on the hdr setting on the camera (beatsaber needed this). In older versions of unity, turning this feature on may crash the game, so only allow hdr on things that actually need it.
(bool) regeneratecamera
Some games like superhot will use different cameras with different behaviors and effects on different levels. Setting this value to true will force ViewR to reconfigure all of its connected device's cameras on each new level event from Unity.
(bool) allowrecording
Binds "e" on your keyboard to start recording. This value is false by default because the feature is still a work in progress, poorly implemented, and causes a heavy performance hit under certain circumstances. Also, some games may have bound "e" to do something else. However, if you really really want to use it, set it to true and find out how to use it here.
viewrmod.cfg
This file configures how the mod is loaded.
The mod cfg for superhot is shown below.
(int) leveltoloadon
The level to load ViewR mod on... pretty straight forward. Setting it to -1 will load the mod immediately on game start, ignoring the actual level.
(string) trackingtype
Type of tracking used by the game. The values can be "steamvr", "unityxr", or "none".
Avatar Settings
These are settings used by the ViewRAvatar, find out more about it here.
(string[]) avatarrighthand
Name of the GameObject that represents right hand of the player, This value is a comma separated list.
(string[]) avatarlefthand
Name of the GameObject that represents left hand of the player, This value is a comma separated list.
(string[]) avatarhead
Name of the GameObject that represents left head of the player, This value is a comma separated list.
(string[]) avatarspace
Name of the GameObject that represents play space, This value is a comma separated list.
(int) avatarlayer
Layer number to remove from camera and to set the avatar to. This prevents the avatar from being visible to the player in VR.
(string[]) avatarhmdcamera
Name of the camera to remove the culling layer from. If the name is "Camera.main", ViewR will use the Camera.main object in Unity. This value is a comma separated list, and will cause ViewR Interface to search for those names in the specified order when a device connects.
Should the viewrcamera.cfg file be blank after patching SuperHot? When I connect with my phone the view is from below the floor and nowhere near the vr player
ReplyDeleteI have encountered the same issue. Have you come across any solutions?
DeleteIt would be handy to include a link to download template config files so we dont have to type / copy and paste all these values in to start
ReplyDelete