Пример #1
0
 void ResetCloud()
 {
     CoreUtils.Destroy(m_CloudSettings);
     m_CloudSettings            = null;
     m_CloudSettingsFromProfile = null;
     m_LastComputedCloudHash    = 0;
 }
Пример #2
0
 void ResetVolumetricCloud()
 {
     CoreUtils.Destroy(m_VolumetricClouds);
     m_VolumetricClouds                = null;
     m_CloudSettingsFromProfile        = null;
     m_LastComputedVolumetricCloudHash = 0;
 }
Пример #3
0
        void UpdateCurrentStaticLightingClouds()
        {
            // First, grab the cloud settings of the right type in the profile.
            CoreUtils.Destroy(m_CloudSettings);
            m_CloudSettings         = null;
            m_LastComputedCloudHash = 0;
            GetCloudFromIDAndVolume(m_StaticLightingCloudsUniqueID, m_Profile, out m_CloudSettingsFromProfile, out var cloudType);

            if (m_CloudSettingsFromProfile != null)
            {
                m_CloudSettings         = (CloudSettings)ScriptableObject.CreateInstance(cloudType);
                m_LastComputedCloudHash = InitComponentFromProfile(m_CloudSettings, m_CloudSettingsFromProfile, cloudType);
            }
        }
Пример #4
0
        public override bool GetSunLightCookieParameters(CloudSettings settings, ref CookieParameters cookieParams)
        {
            var cloudLayer = (CloudLayer)settings;

            if (cloudLayer.CastShadows)
            {
                if (m_PrecomputedData == null || m_PrecomputedData.cloudShadowsRT == null)
                {
                    UpdateCache(cloudLayer, HDRenderPipeline.currentPipeline.GetMainLight());
                }

                cookieParams.texture = m_PrecomputedData.cloudShadowsRT;
                cookieParams.size    = new Vector2(cloudLayer.shadowSize.value, cloudLayer.shadowSize.value);
                return(true);
            }
            return(false);
        }
Пример #5
0
 void GetCloudFromIDAndVolume(int cloudUniqueID, VolumeProfile profile, out CloudSettings cloudSetting, out System.Type cloudType)
 {
     cloudSetting = null;
     cloudType    = typeof(CloudSettings);
     if (profile != null && cloudUniqueID != 0)
     {
         m_VolumeCloudsList.Clear();
         if (profile.TryGetAllSubclassOf <CloudSettings>(typeof(CloudSettings), m_VolumeCloudsList))
         {
             foreach (var cloud in m_VolumeCloudsList)
             {
                 if (cloudUniqueID == CloudSettings.GetUniqueID(cloud.GetType()) && cloud.active)
                 {
                     cloudType    = cloud.GetType();
                     cloudSetting = cloud;
                 }
             }
         }
     }
 }
Пример #6
0
 public override void RenderSunLightCookie(CloudSettings settings, Light sunLight, CommandBuffer cmd)
 => m_PrecomputedData.BakeCloudShadows((CloudLayer)settings, sunLight, cmd);