Forum rules - please read before posting.

HDRP physical camera dof

Hi,
So, I am in process of upgrade to latest unity and upgrading whole thing to HDRP - and I am kind of stuck on how to do DoF correctly.

I managed to make the HDRP volume work (like copyig AC focus distance to HDRP postprocessing volume DoF focus distance )
But, I am trying to use physical camera, so what I would need to do is basically steal physical properties of active "help" camera to "main" AC camera ( same way AC copy FoV between cameras ), I was trying to find where does AC do the FoV copy thing but was unable to find it

Maybe someone also tried to work with AC with HDRP?

Any tips would be highly appreciated.

Comments

  • You can hook into the OnSwitchCamera custom event to transfer the DoF values to the MainCamera whenever switches to a new GameCamera.

    I don't recall exactly which property you need to transfer for the HDRP DoF, but the process would be similar to this example, which updates the camera's FoV in the same way:

    using UnityEngine;
    using AC;
    
    public class TransferCameraValues : MonoBehaviour
    {
    
        private void OnEnable () { EventManager.OnSwitchCamera += SwitchCamera; }
        private void OnDisable () { EventManager.OnSwitchCamera -= SwitchCamera; }
    
        private void SwitchCamera (_Camera old, _Camera newCamera, float transitionTime)
        {
            KickStarter.CameraMain.fieldOfView = newCamera.Camera.fieldOfView;  
        }
    
    }
    
  • Hey Chris, you are the best!
    I added those HDCameraData and can now change lens settings for my camera for each shot, and it looks awesome!

    Thanks a lot!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.