Search Unity

Missed "layer" property at "__CMVolumes" temp object

Discussion in 'Cinemachine' started by SKoptev, Jun 18, 2019.

  1. SKoptev

    SKoptev

    Joined:
    Jan 15, 2019
    Posts:
    37
    Hello Unity team!
    Found a strange bug (in HDRP, cinemachine v.2.3.4) - settings/filters made in CinemachineVolumeSettings components - are not applied to game camera.
    The reason is that "Camera" component has setting "Volume layer mask", and temp object "__CMVolumes" created by CinemachineBrain does not set the property value (it remains the default "0").

    File: com.unity.cinemachine@2.3.4\Runtime\PostProcessing\CinemachineVolumeSettings.cs
    as line 188, has a commented-out lines:
    Code (CSharp):
    1. /*
    2.                 // Update the volume's layer so it will be seen
    3.                 int mask = ppLayer.volumeLayer.value;
    4.                 for (int i = 0; i < 32; ++i)
    5.                 {
    6.                     if ((mask & (1 << i)) != 0)
    7.                     {
    8.                         volumeOwner.layer = i;
    9.                         break;
    10.                     }
    11.                 }
    12. */
    I think that's the reason - as workaround, I set up volumeOwner.layer value as
    Code (CSharp):
    1. int mask = brain.gameObject.GetComponent<HDAdditionalCameraData>().volumeLayerMask;
    2. // other commented code
    and It works fine.

    Please fix this problem! Thanks in advance.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Thanks for this! We will fix.
     
    SKoptev likes this.