Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Individual Blend

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

  1. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    61
    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:
    1,412
    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:
    61
    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:
    1,412
    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:
    61
    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:
    61
    btw @Gregoryl is there a git repository for the cinemachine?
     
  7. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    302
    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:
    61
    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:
    1,412
    @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:
    61
    How can get that value out of the virtual camera?
     
  11. Gregoryl

    Gregoryl

    Unity Technologies

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

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    61
    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:
    7
    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!