Search Unity

Individual Blend

Discussion in 'Cinemachine' started by sebsmax, Jul 26, 2017.

  1. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    I have Camera that are in other additive scenes, is it possible to make to choose a custom blend? Like forcing it to "Cut" ?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Yes. In the CinemachineBrain, you can define an array of custom blends. This is an asset which exists independently of the scene. The From and To camera identifiers are name-based, so if there is a camera with the same name as in the custom blend definition, it will be found and the custom blend will be used
     
  3. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    Thanks @Gregoryl
    Another question on the same topic, how priorities are handled in the custom blends?
    does the list is executed in order and stop as soon as it find a match?
    or all the "Any camera" are weaker than the rest?

    Also, is it possible to avoid to have the camera that "vibrate" when it's transitioning between two blend (it does that in some rare case)
     
    Last edited: Jul 27, 2017
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Yes, the "Any Camera" is weaker.
    For the vibrating, you have to solve that on a case-by-case basis. Normally, it happens when the camera is closely tracking something that is not moving smoothly. It's a question of tracking down the source of the jerky movement.
     
  5. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    It's vibrating for the combat camera when it's not locking a enemy. It's using a target group, i've managed to smooth-it up a bit by having entering and exiting enemies with a "Weight" that is fading in/out. like that it jump less but it's still not as smooth as what I used to have.

    there is also something that I've notice when doing a camera cut, it's cutting and then looking to the target.

    It the following video, you can see how far we got with cinemachine, it's blending with at least 10 cameras (There is the debug view in the top left corner)

     
  6. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    btw @Gregoryl is there a git repository for the cinemachine?
     
  7. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Wow you game looks amazing. Yes, there are some unwanted strange / lumpy camera blends going on. It would be great to see a capture of the gameplay like this but with the Cinemachine debug turned on so we can see the camera switching.

    @sebsmax Your game looks fantastic and is an incredible use-case for Cinemachine. We will make sure you get it working exactly right.

    Yes, there's a giit repository, I'll get that to you in a PM
     
  8. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    I actually found out the issue with the lumpy, instead of switching between cameras with a setActive, I do that:
    Code (CSharp):
    1.  
    2.             cameraExploration.Priority = (cameraMode == CameraModes.Exploration)?10:5;
    3.             cameraCombat.Priority = (cameraMode == CameraModes.Combat) ? 10 : 5;
    4.             cameraCombatLock.Priority = (cameraMode == CameraModes.CombatLock) ? 10 : 5;
    and I continuously update the positions of all Free camera.

    Now I'm trying to put back screen vibrations, but as much as I can dig into the code... I only find one part where the frequency is set, I wanted to do an "On/Off" on each camera with the frequency
    Code (CSharp):
    1. CinemachineBasicMultiChannelPerlin.cs
    2.             float time = mNoiseTime * deltaTime * m_FrequencyGain;
     
    Lazulite and Gregoryl like this.
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    @sebsmax You can play with CinemachineBasicMultiChannelPerlin.m_AmplitudeGain. Setting that to 0 is the same as turning it off. You can animate a pulse on it.
     
  10. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    How can get that value out of the virtual camera?
     
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    CinemachineVirtualCamera vcam;
    vcam.GetCinamchineComponent<CinemachineBasicMultiChannelPerlin>().m_AmplitudeGain = bla;
     
  12. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    Cool I would never have guessed that!

    Code (CSharp):
    1. public CinemachineFreeLook[] CMGameplayCameras;
    2.  
    3. [...]
    4.  
    5.  foreach (CinemachineFreeLook cmFreeLook in CMGameplayCameras)
    6.   {
    7.        for (int i = 0; i < 3; i++)
    8.        {
    9.             cmFreeLook.GetRig(i).GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>().m_AmplitudeGain = shakeIntensity * multiplier;
    10.        }                
    11.   }
     
  13. Mr-Zhou

    Mr-Zhou

    Joined:
    May 4, 2016
    Posts:
    26
    The effect of your sample video about cinemachine is shocking,
    I am learning to use cinemachine,and I don't know how to achieve the effect in your video.
    Can you tell me how the virtual camera in the video is placed, and when do you want to switch the camera?
    Looking forward for your reply, thank you!