Wyattari / VRSmoothCamUnity

Simple camera smoothing prefab to help facilitate the capture of VR content

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VR Smooth Camera Plugin for Unity

Simple camera smoothing tool to help facilitate the in-editor capture of VR content in Unity.

Capturing movement in a VR headset often results in jittery footage because of the natural movement of a head—which is fine for the person wearing the headset, but not great for the person viewing it on a flat screen.

(no smoothing)

The VR Smooth Camera is a simple in-editor tool that allows you to achieve clearer, more cinematic footage for flat screen sharing of VR content. This also allows you to adjust camera settings without affecting the player's perspective, like widening the field of view so in-game hands won’t be cropped out of 16:9 captured footage.

(SmoothDamp position & rotation, wider FOV, locked camera roll)

The goal is to help bridge the gap between what you see on flat screen vs what you experience in VR.

How it Works

  • The package includes a prefab with a camera and smoothing script that follows your preferred target. This allows you to go through motions normally while smoothing is applied to only the separate smoothed camera.
  • You can also enable a window in your VR perspective that allows you to monitor the view of the smoothed camera and make sure you get your framing just right.

Instructions

  • Download the latest release and import the UnityPackage (created in 2019.4)
  • Drop the SmoothCameraFollow prefab into your scene.
  • Attach your VR camera to the follow target field in the SmoothCamFollow script.
  • Make sure the "Depth" or "Priority" field of the VRSmoothCam camera is set so it has higher priority than your VR camera.
  • Use the SmoothCamSettings ScriptableObject to adjust settings.
  • If you want to use the monitor you'll need to create or pick a layer that you can remove from the culling mask on the smoothed camera. Then open the SmoothCameraMonitor prefab and update the MonitorQuad's layer to the culled one.

Things to Note

  • This renders an extra camera simultaneously and it will affect performance.
  • Not intended for Mixed Reality Capture.
  • Not yet intended for runtime use.
  • Currently only uses SmoothDamp, but it's set up to experiment with additional smoothing methods.
  • The "Lock Camera Roll" option currently bugs out when you look straight up or down.

Credits

The idea for smoothing comes from Valve's full in-camera smoothing they used for the trailer of Half-Life: Alyx.

If this has been helpful, ko-fi

May your framerates be high and your cameras smooth!

-Wyatt

About

Simple camera smoothing prefab to help facilitate the capture of VR content

License:GNU General Public License v3.0


Languages

Language:C# 96.5%Language:C++ 3.3%Language:ShaderLab 0.1%Language:C 0.1%Language:HLSL 0.1%Language:GLSL 0.0%