示例#1
0
        protected void OnValidate()
        {
            if (ShaderConfig.s_ProbeVolumesEvaluationMode == ProbeVolumesEvaluationModes.Disabled)
            {
                return;
            }

            ProbeVolumeSettingsKey bakeKeyCurrent = ComputeProbeVolumeSettingsKeyFromProbeVolume(this);

            if (ProbeVolumeSettingsKeyEquals(ref bakeKey, ref bakeKeyCurrent) &&
                m_DebugProbeMatricesList != null)
            {
                return;
            }

            parameters.Constrain();

            bakeKey = bakeKeyCurrent;

            if (probeVolumeAsset)
            {
                if (!IsAssetCompatibleResolution())
                {
                    Debug.LogWarningFormat("The asset \"{0}\" assigned to Probe Volume \"{1}\" does not have matching data dimensions ({2}x{3}x{4} vs. {5}x{6}x{7}), please rebake.",
                                           probeVolumeAsset.name, this.name,
                                           probeVolumeAsset.resolutionX, probeVolumeAsset.resolutionY, probeVolumeAsset.resolutionZ,
                                           parameters.resolutionX, parameters.resolutionY, parameters.resolutionZ);
                }

                dataUpdated = true;
            }

            SetupProbePositions();
        }
示例#2
0
 private static bool ProbeVolumeSettingsKeyEquals(ref ProbeVolumeSettingsKey a, ref ProbeVolumeSettingsKey b)
 {
     return((a.id == b.id) &&
            (a.position == b.position) &&
            (a.rotation == b.rotation) &&
            (a.size == b.size) &&
            (a.resolutionX == b.resolutionX) &&
            (a.resolutionY == b.resolutionY) &&
            (a.resolutionZ == b.resolutionZ));
 }
示例#3
0
 private static bool ProbeVolumeSettingsKeyEquals(ref ProbeVolumeSettingsKey a, ref ProbeVolumeSettingsKey b)
 {
     return((a.id == b.id) &&
            (a.position == b.position) &&
            (a.rotation == b.rotation) &&
            (a.size == b.size) &&
            (a.resolutionX == b.resolutionX) &&
            (a.resolutionY == b.resolutionY) &&
            (a.resolutionZ == b.resolutionZ) &&
            (a.backfaceTolerance == b.backfaceTolerance) &&
            (a.dilationIterations == b.dilationIterations));
 }
示例#4
0
 private void BakeKeyClear()
 {
     bakeKey = new ProbeVolumeSettingsKey
     {
         id          = 0,
         position    = Vector3.zero,
         rotation    = Quaternion.identity,
         size        = Vector3.zero,
         resolutionX = 0,
         resolutionY = 0,
         resolutionZ = 0
     };
 }
示例#5
0
 private void BakeKeyClear()
 {
     bakeKey = new ProbeVolumeSettingsKey
     {
         id                 = 0,
         position           = Vector3.zero,
         rotation           = Quaternion.identity,
         size               = Vector3.zero,
         resolutionX        = 0,
         resolutionY        = 0,
         resolutionZ        = 0,
         backfaceTolerance  = 0.0f,
         dilationIterations = 0
     };
 }