A one minute video, that barely scratches the surface of what can be achieved with induction of Cinemachine for real time filmmaking and Virtual Production (which is the rage in Hollywood right now due to lockdowns). The unity scene is being streamed to the Cellphone Vcam rig over wifi and driven by Unity WebRTC/Webstreaming package.
While I keep experimenting, here are a few areas that I think different teams from Unity can stitch together within a couple of weeks, given these already exist in āunity silosā
Expose Cinemachine Camera properties: Focal length etc - so they can be overridden if so desired by Cinematographers (using some kind of input such as midi/OSC, webrtc)
Cinemachine ability to trigger Unity Recorder to do a ātakeā - recording at least a camera path move and proxy rez mp4 video (quality configurable in recorder)
Cinemachine Extension Module:Manual Override using phone Gyro/ accelerometer: This could be implemented thereby giving an operator the ability to pan/tilt and add organic, human ācamera shakeā
Food for thought:
- Cinemachine Webrtc / Webstreaming integration: The team at Cinemachine and Webrtc should work closer on creating a āVirtual Productionā camera, driven by Arkit and Arcore. (UE4 already has one)
Cinemachine Midi and OSC integration: Native OSC integration would allow for all parameters to be driven / overridden by hand for aspects of control while Cinemachine brain handles tracking and switching. In-fact, under OSC control, users can design their own Control surfaces using TouchOSC for Camera switching based on priority, Focal and ISO etcā¦
- Cinemachine integration with FREE-D protocol: Cinemachine virtual camera drives for instance, the affordable (for broadcasters) Panasonic AW-UE150 PTZ camera.
Trouble Shooting:
Free Look Cam and Exposure. I donāt know if this is a bug unique to me, but in using Unity 2019.3.9 with latest Cinemachine (2.5.0) and HDRP 7.3.1, I find that only on the Freelook camera I need to set ISO to some abnormally high number such as 25000, and open aperture wide, otherwise the scene is dark.
There is no Cinemachine postprocessing volume override on the Freelook camera and all other Cinemachine cameras respect the global Volume settings I have (ISO and Shutter are set to be responsive to the Exposure component in the Global volume)
This is something to check for, if anyone else can confirm?
@Dirrogate Thanks for the excellent feedback. Iām having trouble reproducing your exposure issue. Can you put together a small project that demonstrates this and send it to me?
@Gregoryl Iāll get back to this soon, since Iām thinking a Virtual Camera following a target and with Aim set to POV might better serve my purpose of creating a manual āSteadycamā
But I do want to escalate a request if possible: Expose Cinemachine Camera properties: Focal length etc - so they can be overridden if so desired by Cinematographers (using some kind of input such as midi/OSC, webrtc)
Take a look at this project Iām working on as experiments to build a Virtual Production solution for myself in Unity.
The camera switching is not done via timeline or script, but over OSC protocol driven by sliders and switches created on an android phone/tablet (via TouchOSC). The light flicker is also driven manually by a fader over OSC protocol.
Iām sorely missing functions like Focal length, Focus, aperture, Iso and shutter. These are not exposed by Cinemachine cameras (via reflection) as normal Unity cameras are.
Iād like Cinemachine to do itās thing like following a target, dolly etc⦠while letting some settings have manual over-ride.
Assuming youāre using HDRP.
If you set this in your Camera:
then your Cinemachine vcams will have an expanded lens section:
you can write a script to drive all those fields.
Focus distance is trickier, due to the way the Unity physical camera is set up. If you add a CinemachineVolumeSettings extension to the vcam, you will have ability to pull focus by animating the Focus Offset field (offset is relative to the camera - you can change that by changing the Focus Tracking setting).
Set it up like this (make sure Resolution is set to Full or it will look bad):
Thank you for this tip @Gregoryl .
On the other aspects, yes I am using HDRP and the physical camera. My lament is that Cinemachinesā implementation of the physical camera has hidden/broken previously exposed parameters of the original Physical camera such as focal length.
For instance, these parameters were exposed (to non programmer cinematographers) by simply creating Unity Gui sliders/buttons and dragging functions such as Focal length etc as in the attached images.
It would be good to have this functionality restored.
For now, I tried this script - which works perfectly - for non cinemachine cameras
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
[RequireComponent(typeof(HDAdditionalCameraData))]
public class HDCameraAppatureMapping : MonoBehaviour
{
[SerializeField] OscIn _oscIn = null;
[SerializeField] string _appatureAddress = "/oscControl/aperture";
void Awake()
{
HDAdditionalCameraData data = GetComponent<HDAdditionalCameraData>();
_oscIn.MapFloat(_appatureAddress, (float value) => data.physicalParameters.aperture = value);
}
}
But now when I add it to a basic (dummy) Cinemachine Vcam, it āaddsā another camera component + the HDAdditionalCameraData component, resulting in a black output.
The code above was kindly given to me by the author of the excellent OSCsimpl asset from the asset store. I was/am successfully using this code (before incorporating Cinemachine) and OSC (a signalling protocol like midi) to drive Unity cameras for live Virtual Production.
Iām guessing the code needs to be modified to not load the HDAdditionalCameraData component now, to access Cinemachine physical camera properties.
Iām not sure if I understood your question completely, but hereās some pointers how to access the Cinemacine things:
You can access Cinemachine camera datas by just getting the component, like that CinemachineVirtualCamera:
@Gregoryl@Olmi would you know what the value for Focal length is? I canāt find it.
Iāve found m_Lens.Iso, m_Lens.ShutterSpeed, m_Lens_Aperture.
Thereās one called field of view - which technically is only going to around 106 (and isnāt the same as focal length)
Above can be found in LensSettingsPropertyDrawer.cs, I think? Although itās not exact same code. (It uses epsilon constant instead of that small float valueā¦) Anyway.
@Gregoryl Iāve got one more important bit left. Iād like to do a rack focus via a remote slider.
Currently it works fine for regular Physical cameras with this script:
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using Cinemachine;
public class CinemachineDofOsc : MonoBehaviour
{
DepthOfField depthOfField;
[SerializeField] OscIn _oscIn = null;
[SerializeField] string _dofAddress = "/oscControl/dof";
void Awake()
{
Volume volume = GetComponent<Volume>();
DepthOfField tempDof;
if (volume.profile.TryGet<DepthOfField>(out tempDof))
{
depthOfField = tempDof;
}
_oscIn.MapFloat(_dofAddress, (float value) => depthOfField.focusDistance.value = value);
}
}
How would I go about setting this script to address the āFocus Offset fieldā. Could you help?
Also, in the image you posted above, above the offset field there is Focus tracking dropdown.
I donāt see that in the latest version of Cinemachine. 2.5.0
Iāve just completed āRackFocusā with Cinemachine.
This allows for manual override via OSC or Midi and complements Cinemachinesā AI driven camera rather well.
Turns out it was GetComponent<Cinemachine.PostFX.CinemachineVolumeSettings>();
Hereās the code for anyone else that might need to control Cinemachine parameters manually.